write a program to swap Two numbers without using temp variable.
Answer Posted / guest
# include "stdio.h"
main()
{
int a,b;
printf("enter two numbers for swaping");
scanf("%d%d",&a,&b);
a=a+b;
b=a-b;
a=a-b;
printf("a is %d",a);
printf("b is %d",b);
} output:- takea,b value is 2,3 and give answers is3,2
| Is This Answer Correct ? | 243 Yes | 58 No |
Post New Answer View All Answers
Can a variable be both const and volatile?
What is difference between main and void main?
List at least 10 sorting methods indicating their average case complexity, worst case complexity and best case complexity.
Explain what is the best way to comment out a section of code that contains comments?
What is the use of header files?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
Why & is used in scanf in c?
What is maximum size of array in c?
What is a good data structure to use for storing lines of text?
What are the c keywords?
What is a structure member in c?
What are the advantages and disadvantages of a heap?
What is the correct declaration of main?
Can we assign integer value to char in c?
What is main () in c language?