Welcome to my blog this is test

28 June 2012

1. write a C program to interchange among two variables without use of temp variable.:






#include
#include
 void main()
  {
   int c,d,temp=0;
   clrscr();
   printf("\n Enter the values of c and d : ");
    scanf("%d%d",&c,&d);
        temp=c;
           c=d;
           d=temp;
  printf("\n After interchanging the value of c and d are : %d %d",c,d);
   getch();
  }

/*Output:
Enter the values of c and d : 45 23
After interchanging the values of c and d are : 23 45









No comments:

Post a Comment