Write a C program that prints the minimum cost of a tour using scanf to input the costs of specific cities and use that to get the minimum cost.
for example the input might look like the following
1 2 500 //the first and second numbers would represent the cities and the third is the cost.
2 3 456
3 1 345
1 4 445
The printf of the output will be:
printf("the Tour %d %d %d %d cost %d", a, b, c, a, cost);
and Now the example of an output will say the following using numbers from the user:
The tour 1 2 3 1 costs 790
Comments
Leave a comment