Monday 6 April 2020

Program to swap two numbers

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b,temp;
clrscr();
printf(“enter value for a & b: ”);
scanf(“%d%d”,&a,&b);
temp=a;
a=b;
b=temp;
printf(“after swapping the value of a & b: %d %d”,a,b);
getch();
}

No comments:

Post a Comment