write a program to swap Two numbers without using temp variable.
Answer Posted / sree
#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("Enter two numbers");
scanf("%d %d",&a &b);
a=a+b;
b=a-b;
a=a-b;
printf("The swapped values are:");
printf("a:%d",a);
printf("b:%d",b);
getch();
}
| Is This Answer Correct ? | 73 Yes | 24 No |
Post New Answer View All Answers
What are the 4 types of functions?
Is anything faster than c?
how do you execute a c program in unix.
program to convert a integer to string in c language'
Is array name a pointer?
c program for searching a student details among 10 student details
What is string concatenation in c?
What is the use of putchar function?
Tell me is null always defined as 0(zero)?
Here is a neat trick for checking whether two strings are equal
how many errors in c explain deply
What is the difference between int main and void main in c?
What is the importance of c in your views?
Why doesnt that code work?
What is memory leak in c?