google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: Swapping: (Example 2) Write a c program to swap two numbers without usin...

Thursday, March 2, 2017

Swapping: (Example 2) Write a c program to swap two numbers without usin...

/* 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();
}


No comments:

Post a Comment