write a program to swap Two numbers without using temp variable.

Answer Posted / naresh

main()
{
int a,b,c;
printf("enter a,b value");
scanf("%d%%d",&a,&b);
c=a^=b^=a^=b;
printf("%d",c);
}

Is This Answer Correct ?    67 Yes 150 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How macro execution is faster than function ?

660


I have seen function declarations that look like this

594


What is the correct code to have following output in c using nested for loop?

608


What is the purpose of sprintf?

615


What are the standard predefined macros?

627






What are linked lists in c?

645


What is a struct c#?

599


What are different types of operators?

592


pgm to find any error in linklist(in single linklist check whether any node points any of previous nodes instead of next node)

2197


What math functions are available for integers? For floating point?

616


Explain what is the difference between a free-standing and a hosted environment?

630


what are enumerations in C

718


What are the modifiers available in c programming language?

729


what do the 'c' and 'v' in argc and argv stand for?

641


List the difference between a While & Do While loops?

629