C Program to Swap Two Number
#include<stdio.h>#include<conio.h>void main(){int first, second, third;printf("Enter first number: ");scanf("%d", &first);printf("Enter second number: ");scanf("%d", &second);// Value of first is assigned to thirdthird = first;// Value of second is assigned to firstfirst = second;// Value of third(initial value of first) is assigned to secondsecond = third;printf("\nAfter swapping, first Number = %d\n", first);printf("After swapping, second Number = %d", second);getch();}

No comments:
Post a Comment
for more information please share like comment and subscribe