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 the use of pointers in C?
Define macros.
Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.
What is the use of a static variable in c?
hi... can anyone help me to make a two-dimensinal arrays in finding the sum of two elements plzzz. thnx a lot...
How can you tell whether a program was compiled using c versus c++?
Is it acceptable to declare/define a variable in a c header?
What is difference between %d and %i in c?
console I/O functions means a) the I/O operations done on disk b) the I/O operations done in all parts c) the input given through keyboard is displayed VDU screen d) none of the above
Explain what are the different data types in c?
What are predefined functions in c?
why we wont use '&' sing in aceesing the string using scanf
How do we make a global variable accessible across files? Explain the extern keyword?
What are # preprocessor operator in c?
Explain what are multibyte characters?