how to swap two integers 1 and 32767 without using third
variable

Answer Posted / susmita dutta chowdhury

b=(a+b)-(a=b);
printf("%d %d ",a,b);
explanation:-
b=(1+32767)-(a=32767)
b=32768-32767
b=1
a=32767

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is scope rule in c?

605


What is infinite loop?

630


Why is not a pointer null after calling free? How unsafe is it to use (assign, compare) a pointer value after it is been freed?

603


What are the back slash character constants or escape sequence charactersavailable in c?

686


What is static function in c?

635






Is it valid to address one element beyond the end of an array?

675


Where define directive used?

607


What are bitwise shift operators in c programming?

646


What language is c written?

577


Do you know null pointer?

611


i have a written test for microland please give me test pattern

2183


in any language the sound structure of that language depends on its a) character set, input/output function, its control structures b) character set, library functions, input/output functions its control structures c) character set, library functions, control sturctures d) character set, operators, its control structures

677


program to convert a integer to string in c language'

1984


p*=(++q)++*--p when p=q=1 while(q<=6)

1266


Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?

2118