swap two integer variables without using a third temporary
variable?

Answer Posted / onkar koparde

i'll only give u logic #include<stdio.h>
void main() { int a=10,b=20;
printf("b4 swap:a=%d b=%d",a,b);
a=a+b;b=a-b;a=a-b; printf("aftr
swap:a=%d b=%d",a,b); }
from-onkar.koparde@gmail.com

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do you write a program which produces its own source code as output?

610


If I have a char * variable pointing to the name of a function ..

657


How many types of operators are there in c?

622


a construct the"else" part of "if" statement contains anoth "if else" statement is called a) if-else b) else-if-else c) if-else-if-else d) chain if/if-else-if

708


Is c is a high level language?

624






The % symbol has a special use in a printf statement. Explain how would you place this character as part of the output on the screen?

669


What is strcpy() function?

660


What are the 5 organizational structures?

571


How do we make a global variable accessible across files? Explain the extern keyword?

1425


How can you be sure that a program follows the ANSI C standard?

1133


What's the total generic pointer type?

618


What are qualifiers and modifiers c?

551


Is there any demerits of using pointer?

634


What is the 'named constructor idiom'?

644


How variables are declared in c?

575