Write a program to input two unequal numbers. Display the numbers after swapping their
values in the variables without using a third variable.
Sample Input: a=76, b=65
Sample Output: a=65, b=75
Answers
Answered by
0
Answer:
Explanation:
#Include<stdio.h>
int main(){
printf("enter the value of a: \n");
scanf("%d\n",&a);
printf("enter the value of b: \n");
scanf("%d\n",&b);
a = a+b;
b = a - b;
a= a- b;
printf("After swapping a: %d b: %d ",a,b);
}
Answered by
2
Answer:
class abc
{
public static void main(String args[])
{
int a=10;
inter b=20;
System. out. println("a= "+a+"b= "+b) ;
a=a+b;
b=a-b;
a=a-b;
System. out. println("a= "+a+"b= "+b) ;
}
}
check the output
hope it will help you
Similar questions