write a program to swap Two numbers without using temp variable.
Answer Posted / gouttam pradhan
#include<stdio.h>
main()
{
int a,b;
printf("enter two numbers");
scanf("%d%d",&a&b);
a=a+b;
b=a-b;
a=a-b;
printf("swaped valuess= ",);
printf("a=%d",a);
printf("b=%d",b);
getch();
}
| Is This Answer Correct ? | 6 Yes | 0 No |
Post New Answer View All Answers
What is the easiest sorting method to use?
What is the use of bit field?
How to write a multi-statement macro?
Can an array be an Ivalue?
What is getch() function?
Why isn't any of this standardized in c? Any real program has to do some of these things.
How can I check whether a file exists? I want to warn the user if a requested input file is missing.
Why c is a procedural language?
What is the difference between Printf(..) and sprint(...) ?
What are the data types present in c?
Why do we use namespace feature?
What is a structure member in c?
Explain how do you determine the length of a string value that was stored in a variable?
What is use of null pointer in c?
Write a program to find factorial of a number using recursive function.