PropellerAds

Showing posts with label swap. Show all posts

Program/code to swap two numbers in C language

This code demonstrate the swaping of two numbers.

//program to swap two numbers input by user
#include<stdio.h>
#include<conio.h>
void main()
{
int x,y,a;

printf("Enter x:");
scanf("%d",&x);
printf("Enter y:");
scanf("%d",&y);
a=x;
x=y; 
y=a;
printf("x is %d\n",x);
printf("y is %d",y);
getch();
}
Saturday, 17 January 2015
Posted by Unknown
PropellerAds
PropellerAds

Popular Post

Powered by Blogger.

- Copyright © BSCS -Metrominimalist- Powered by Blogger - Designed by Johanes Djogan -