Computer Science, asked by hemantkumar6975, 10 months ago

Write a program to swap two numbers.

Answers

Answered by sunitapandey351
1

MATE THE ANSWER TO YOUR QUESTION IS THE ABOVE PICTURE HOPE YOU GOT IT MARK AS BRAINLIEST

Attachments:
Answered by mindfulmaisel
1

Program to swap two numbers using C Language

Explanation :

#include<conio.h>

#include<stdio.h>

void main()

{

int a,b,temp;

printf("Enter the value of a:");

scanf("%d",&a);

printf("Enter the value of b:");

scanf("%d",&b);

temp=a;

a=b;

b=temp;

printf("The values after the swap is a=%d,b=%d",a,b);

getch();

}

output :

Enter the value of a:5

Enter the value of b:2

the values after the swap is a=2,b=5

TO KNOW MORE ABOUT:

1.Write a program to swap two numbers with the help of third variable​brainly.in/question/10183132

2.Write a program in Java to swap two numbers

brainly.in/question/13323835

Similar questions