Pages

Tuesday, January 14, 2014

[H]. (f) Two numbers are input through the keyboard into twolocations C and D. Write a program to interchange the contents of C and D.

void main()
{
 int a, c, d;
 clrscr();
 printf("Enter Value in C : ");
 scanf("%d",&c);
 printf("Enter Value in D : ");
 scanf("%d",&d);
 a=c;
 c=d;
 d=a;
 printf("C = %d ",c);
 printf("\nD = %d",d);
 getch();
}

No comments:

Post a Comment