Write a C program to interchange two numbers.

#include <stdio.h>

int main() 
{
 int a,b;
 printf("Enter Value of a :");
 scanf("%d",&amp;a);
 printf("Enter Value of b :");
 scanf("%d",&amp;b);

 a=a+b;
 b=a-b;
 a=a-b;

 printf("\nAfter Swapping Values a = %d b = %d",a,b);
 return 0;
}

Next practical link : Practical 5

Categories: GTU PRACTICALSPPS

0 Comments

Leave a Reply

Your email address will not be published. Required fields are marked *