ProAnswers.org

C program to swap multipale values

Write a program in C to swap multipale value

the question it self is wrong.
swapping is possible between 2 values only. for multiple values it will be circular replacement.

swap dictionary meaning:“An exchange of one thing for another.”

i want to say if the input is 1,2,3,4,5,9,6 then the output is 6,9,5,4,3,2,1

I guess you are looking for reverse the order of numbers?

yes . please done the program

main()
{
int a,b,c;
printf(“Enter number: );
scanf(”%d",a);
printf("Reversal of number: ");

b = a;

do {
b = b/10;
c = a - (b*10);
printf("%d",c);
a = a/10; } while(b>0);

getch();

}

I hope you are expecting this