//Program
#include<stdio.h>
void main()
{
int a,b,temp;
clrscr();
printf("Enter any two numbers:");
scanf("%d %d",&a,&b);
prinft("Before swapping of numbers: a=%d and b=%d",a,b);
temp=a;
a=b;
b=temp;
printf("After swapping of numbers: a=%d and b=%d",a,b);
getch();
}
Sample Input/Output:
Enter any two numbers:10
20
Before swapping of numbers a=10 and b=20
After swapping of numbers a=20 and b=10
#include<stdio.h>
void main()
{
int a,b,temp;
clrscr();
printf("Enter any two numbers:");
scanf("%d %d",&a,&b);
prinft("Before swapping of numbers: a=%d and b=%d",a,b);
temp=a;
a=b;
b=temp;
printf("After swapping of numbers: a=%d and b=%d",a,b);
getch();
}
Sample Input/Output:
Enter any two numbers:10
20
Before swapping of numbers a=10 and b=20
After swapping of numbers a=20 and b=10
No comments:
Post a Comment