/* This is a program in C language to swap two numbers */
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,temp;
clrscr();
// asking user to enter two numbers
printf("Enter number1 :");
scanf("%d",&num1);
printf("Enter number2 :");
scanf("%d",&num2);
// swaping
temp = num1;
num1 = num2;
num2 = temp;
// printing swapped number
printf("After swapping \nnumber1 = %d \nnumber2 = %d",num1,num2);
getch();
}
/*
Developed by
Avichal Vishnoi
on 2020.06.02 at 11:15 AM
*/
#include<stdio.h>
#include<conio.h>
void main()
{
int num1,num2,temp;
clrscr();
// asking user to enter two numbers
printf("Enter number1 :");
scanf("%d",&num1);
printf("Enter number2 :");
scanf("%d",&num2);
// swaping
temp = num1;
num1 = num2;
num2 = temp;
// printing swapped number
printf("After swapping \nnumber1 = %d \nnumber2 = %d",num1,num2);
getch();
}
/*
Developed by
Avichal Vishnoi
on 2020.06.02 at 11:15 AM
*/
Comments
Post a Comment