Thursday, May 7, 2015

write a program to interchange two number

/*
 Two number are input through the keyboard into two location C and D .
 Write a program to interchange the contents of C & D.
*/


#include<stdio.h>
#include<conio.h>
main()
{
      int c,d,e;
      printf("Enter the number at Loaction C and D....");
      scanf("%d%d",&c,&d);
      e=c;
      c=d;
      d=e;
      printf("\n New Number at location C.. %d",c);
      printf("\n New Number at location D.. %d",d);
      printf("\n\n\nEnter Any key for Exit.......");
      getch();
     
     
      }
     
Output:-

No comments:

Post a Comment

Featured Post

What is JavaScript? What is the role of JavaScript engine?

  The JavaScript is a Programming language that is used for converting static web pages to interactive and dynamic web pages. A JavaScript e...