j

Saturday, 7 November 2015

Write a program that take values of a and b than enterchange their values

Program Solution

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,temp;
printf("Enter the values a and b ::");
cin>>a>>b;
printf("The value of a before change :: %d\n",a);
printf("The value of b before change :: %d\n"b);
temp=a;
a=b;
b=temp;
printf("The value of a after change :: %d\n",a);
printf("The value of b after change :: %d",b);
getch();
}

Output

Subscribe to this Blog via Email :