4. Write a C program to interchange two numbers.

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,c;
printf("a=");
scanf("%d",&a);
printf("b=");
scanf("%d",&b);
printf("Before interchange a=%d b=%d\n",a,b);
c=a;
a=b;
b=c;
printf("After interchange a=%d b=%d",a,b);
getch();
}

#Output:


Comments

Popular posts from this blog