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
How can I open a file so that other programs can update it at the same time?
why return type of main is not necessary in linux
What does the error message "DGROUP exceeds 64K" mean?
Explain how can a program be made to print the name of a source file where an error occurs?
How many levels of pointers can you have?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
When should structures be passed by values or by references?
I have written a pro*C program to fetch data from the cursor. where in i have used the concept of BULK FETCH.... each FETCH statement is taking lots of time to fetch specified number of rows at...
What is sizeof in c?
Explain what is output redirection?
Why pointers are used in c?
a function gets called when the function name is followed by a a) semicolon (;) b) period(.) c) ! d) none of the above
What is the usage of the pointer in c?
What are the 5 organizational structures?
An integer that indentifies the position of a data item in a sequence of data items a) value b) number c) index d) all of the above