google-site-verification: googlef8aa845b858144d3.html COMPUTER SCIENCE NOTES: Swapping: (Example 3) Write C program to swap two numbers using third va...

Thursday, March 2, 2017

Swapping: (Example 3) Write C program to swap two numbers using third va...

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





No comments:

Post a Comment