/* 3 program of swap 2 number */
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
clrscr();
printf("Enter the value of a:");
scanf("%d",&a);
printf("\nEnter the value of b:");
scanf("%d",&b);
temp=a+b;
b=temp-b;
a=temp-a;
printf("Value of a =%d\nValue of b =%d",a,b);
getch();
}
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
clrscr();
printf("Enter the value of a:");
scanf("%d",&a);
printf("\nEnter the value of b:");
scanf("%d",&b);
temp=a+b;
b=temp-b;
a=temp-a;
printf("Value of a =%d\nValue of b =%d",a,b);
getch();
}
No comments:
Post a Comment