Tuesday, December 6, 2011

Write a C Program to swapping by using third variablr

#include <stdio.h>
#include <conio.h>
void main()
{
 int a,b,c;
 clrscr();
 printf("Enter Value for a and b: ");
 scanf("%d %d",&a,&b);
 c=a;
 a=b;
 b=c;
 printf("\nAfter swapping\na and b is: %d %d",a,b);
 getch();
}

No comments:

Post a Comment