write a program to swap Two numbers without using temp variable.
Answer Posted / romeld
#include<stdio.h>
main()
{
int a,b;
printf("enter the value of a and b\n");
scanf("%d%d",&a,&b);
printf("before swapping\na=%d\nb=%d\n",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swapping\na=%d\nb=%d\n",a,b);
getch();
}
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is an operator?
Can static variables be declared in a header file?
Can a function argument have default value?
a linearly ordered set of data elements that have the same structure and whose order is preserved in storage by using sequential allocation a) circular b) ordinary c) array d) linear list
Are global variables static in c?
why wipro wase
Write a c program to build a heap method using Pointer to function and pointer to structure ?
Explain what is the general form of a c program?
What do you mean by dynamic memory allocation in c? What functions are used?
Write a program to reverse a linked list in c.
write a c program to calculate sum of digits till it reduces to a single digit using recursion
What is a good data structure to use for storing lines of text?
how could explain about job profile
What are the different types of control structures in programming?
Are the outer parentheses in return statements really optional?