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
How can you convert integers to binary or hexadecimal?
What does return 1 means in c?
Is int a keyword in c?
Are pointers integers in c?
What is a sequential access file?
In which header file is the null macro defined?
how much salary u want ? why u join in our company? your domain is core sector why u prefer software ?
Explain goto?
What is difference between array and structure in c?
Difference between pass by reference and pass by value?
What is use of bit field?
How do you determine whether to use a stream function or a low-level function?
Explain what is the concatenation operator?
What is the use of pragma in embedded c?
What are pointers in C? Give an example where to illustrate their significance.