Here's the question: Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.
I think my program interchanges the values of 2 variables... Is that the same as interchanging the 'contents of 2 locations'? :confused:Code:#include<stdio.h>
main()
{
int c,d;
printf( "\nEnter c value:" );
scanf( "%d", &c );
printf( "\nEnter d value:" );
scanf( "%d", &d );
printf("\nc=%d", d);
printf( "\nd=%d", c);
getchar();
getchar();
}

