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