write a program to swap Two numbers without using temp variable.
Answer Posted / biren
#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
b=a+b-(a=b);
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}
| Is This Answer Correct ? | 3 Yes | 4 No |
Post New Answer View All Answers
Explain what are multibyte characters?
Why do we need a structure?
Where are some collections of useful code fragments and examples?
Where is volatile variable stored?
Explain what are compound statements?
Explain about block scope in c?
What do you mean by keywords in c?
What are the advantages and disadvantages of a heap?
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
why arguments can generally be passed to functions a) sending the values of the arguments b) sending the addresses of the arguments c) a & b d) none of the above
Define the scope of static variables.
What is void c?
How do you sort filenames in a directory?
Is c++ based on c?
What is the difference between constant pointer and constant variable?