How to swap two values using a single variable ?
condition: Not to use Array and Pointer ?
Answer Posted / ankit anupam
well i think this was wht u were lookin for
#include<stdio.h>
int main()
{
int a, b;
printf("Enter two no");
scanf("%d%d",&a,&b);
printf("a=%d nd b=%d",a,b);
a=a+b;
b=a-b;
a=a-b;
printf("a=%d nd b=%d",a,b);
return 0;
}
| Is This Answer Correct ? | 16 Yes | 3 No |
Post New Answer View All Answers
What is the explanation for prototype function in c?
What is the best way to comment out a section of code that contains comments?
The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none
What is the best style for code layout in c?
Why static is used in c?
What is pivot in c?
What is the difference between āgā and āgā in C?
What does node * mean?
What is header file in c?
How to write a multi-statement macro?
What does p mean in physics?
How to get string length of given string in c?
Can variables be declared anywhere in c?
What does the c preprocessor do?
What is gets() function?