Subscribe

Header Ads

Write a program in C to swap 2 numbers.(By using 3rd variable)



 Program in C to add 2 numbers 

 #include<stdio.h>
#include<conio.h>
int main()
{
int a,b,c;
printf("Enter the value of a = ");
scanf("%d",&a);
printf("Enter the value of b = ");
scanf("%d",&b);
c=a;
a=b;
b=c;
printf(" Value in a = %d \n Value in b = %d",a,b);
return 0;
}

Output:-







Post a Comment

0 Comments