Swap Two Number
Swap two number program is nothing just exchange their values.#include<stdio.h>Output
#include<conio.h>
void main()
{
int a,b;
clrscr();
textcolor(RED);
gotoxy(25,18);
cprintf("enter valu of a = ");
scanf("\n%d",&a);
gotoxy(25,20);
textcolor(2);
cprintf("enter valu of b = ");
scanf("\n%d",&b);
a=a+b;
b=a-b;
a=a-b;
gotoxy(25,24);
cprintf("a= %d b= %d",a,b);
getch();
}
No comments:
Post a Comment