Pages
Home
C.S. Blog
About Amit Ranjan
Contact Amit Ranjan
A Boy From Sitamarhi
Thursday, 30 August 2012
Two numbers are input through the keyboard into two locations C and D. Write a program to interchange the contents of C and D.
main()
{
int C,D;
printf("Enter two numbers\n");
scanf("%d%d",&C,&D);
printf("C = %d\nD = %d\n",C,D);
C=C+D; D=C-D; C=C-D;
printf("After interchanging result is :-\n");
printf("C = %d\nD = %d\n",C,D);
}
output:-
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment