write a program to swap Two numbers without using temp variable.
Answer Posted / sneha chorghade
#include<stdio.h>
void main()
{
int a=2,b=3;
printf("before swap the value is:::");
printf("a=%d\tb=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("after swap the value is:::");
printf("a=%d\tb=%d",a,b);
}
| Is This Answer Correct ? | 4 Yes | 1 No |
Post New Answer View All Answers
Who developed c language and when?
Why pointers are used in c?
Write a factorial program using C.
Can static variables be declared in a header file?
Explain what is a static function?
Write a program to print fibonacci series using recursion?
What is void main ()?
How arrays can be passed to a user defined function
Explain two-dimensional array.
Explain the advantages of using macro in c language?
Which header file is used for clrscr?
What is the purpose of clrscr () printf () and getch ()?
What is a ternary operator in c?
How can I find out the size of a file, prior to reading it in?
What is file in c language?