Swapping two numbers using temporary variable.
The output:
#include <stdio.h> int main () { int a,b,temp; printf("Enter the numbers"); printf("\nEnter the Value of A: "); scanf("%d",&a); printf("Enter the Value of B: "); scanf("%d",&b); printf("\n Before Swapping the values of A and B are A = %d B = %d",a,b); temp=a; a=b; b=temp; printf("\n After Swapping the values of A and B are A = %d B = %d",a,b); return 0; }
The output:
Post a Comment