How to swap two values using a single variable ?
condition: Not to use Array and Pointer ?
Answer Posted / jyotsna
let take a single variable 'x'
a=3
b=2
hence
x=a;
a=b;
b=x;
swapping is occured now a=2 and b=3
| Is This Answer Correct ? | 10 Yes | 12 No |
Post New Answer View All Answers
What is auto keyword in c?
How can I recover the file name given an open stream?
Give basis knowledge of web designing ...
What is a floating point in c?
a number whose only prime factors are 2,3,5, and 7 is call humble number,,write a program to find and display the nth element in this sequence.. sample input : 2,3,4,11,12,13, and 100.. sample output : the 2nd humble number is 2,the 3rd humble number is 3,the 4th humble number is ,the 11th humble number is 12, the 12th humble number is 14, the 13th humble number is 15, the 100th humble number is 450.
What is typedf?
how to write optimum code to divide a 50 digit number with a 25 digit number??
When is a void pointer used?
Do array subscripts always start with zero?
Differentiate between functions getch() and getche().
How to implement a packet in C
In the DOS enveronment, normal RAM that resides beyond the 1mb mark. a) expanded memory b) swapped memory c) Extended memory d) none
What is bin sh c?
Why can arithmetic operations not be performed on void pointers?
What are structural members?