this is a simple selection sort C program ok(sorry for letting me put up a C progam in a C++ forum, I hope its just the syntax change and this is a very basic program so you wont mind)
printf("size of the array:");
printf("enter the terms:");
temp = a[i];
printf("\n\t The ascending order list os ..:\n");
Can some one explain the program properly?
1) Does the program doesnt have the value or N right? as in the no. of terms.?
2) first for loop, i=1, that 1 is the address of the set of numbers or it is the no it self?
3) If it is the numbers that are to be ordered in ascending order, then say N=5, it will be 1 2 3 4 5 right? So the first forloop i=1, the 1 is the address right?
4) The second for loop, N-1? Can you please explain how for loops exactly works
5) The main problem is that i am not able to get a proper perspective of coding to a computer. Step by step. please explain the program properly and also the for loops.
I understood the swapping part. But I dont understand where the comparing part is done .