PROJECT: Swaping in Three Variables

Learn and Trouble Shoot Problems Related to C-Language here.

PROJECT: Swaping in Three Variables

Unread postby rajeevmahura » Thu May 22, 2008 6:03 pm

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
clrscr();
printf("Enter Any Number for a :- ");
scanf("%d",&a);

printf("Enter Any Numebr for b :- ");
scanf("%d",&b);

printf("Before Swaping\na:- %d\nb:- %d",a,b);
c=a;
a=b;
b=c;

printf("\n\nAfter Swaping\na:- %d\nb:- %d",a,b);
getch();
}
---------------------------------------------------
Input: a=5,b=9
Output:Before Swaping
a:- 5
b:- 9

After Swaping
a:- 9
b:- 5
--Regards--
Rajeev Mahura
Servers & Storage Professional
http://about.me/rajeevmahura
User avatar
rajeevmahura
 
Posts: 144
Joined: Tue May 20, 2008 5:22 pm
Location: Bangalore | New Delhi
Full Name: Rajeev Mahura
Date Of Birth: 15 Jan 1984
Address: New Delhi
Profession: DOEACC Trainer
DOEACC Center: DOEACC DELHI
Mobile No: 0

Return to C-Language

Who is online

Users browsing this forum: No registered users and 2 guests

cron