Search & Find out

Thursday, November 26, 2009

Swap two numbers

 Swapping two numbers



#include "stdio.h"
#include "conio.h"
void main()
{
int num1;
int num2;
int temp;
clrscr();
printf("Enter the first num: \t");
scanf("%d",&num1);
printf("Enter the second number: \t");
scanf("%d",&num2);
temp=num1;
num1=num2;
num2=temp;
printf("\nAfter swaping the numbers are\n");

printf("\n\n The first numberis %d \t",num1);
printf("\n\n The second number is %d \t",num2);

getch();
}


Download the executable (.exe)  file for this program..
download


0 comments:

Post a Comment

 

My Blog List

Term of Use