Thursday, 2 January 2014

Swap Two Numbers

A program that swap two numbers



#include <stdio.h>

int main()
{
   char x, y, swap;

   printf("Enter the value of x and y\n");
   scanf("%c%c", &x, &y);

   printf("Before Swapping \n x = %c \n y = %c \n ",x,y);

   swap = x;
   x = y;
   y = swap;

   printf("After Swapping \n x = %c \n y = %c \n ",x,y);

getch();

}

No comments:

Post a Comment