HOW TO SWAP TWO NOS IN ONE STEP?

Answer Posted / sasikumar

main()
{
int a,b,c;
printf("enter two no's :");
scanf("%d%d",&a,&b);
c=a^=b^=a^=b;
printf("%d",c);
}

Is This Answer Correct ?    6 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are register variables? What are the advantage of using register variables?

671


What is the auto keyword good for?

615


What is the general form of a C program?

593


Why main is not a keyword in c?

637


Is there a way to jump out of a function or functions?

627






what is different between auto and local static? why should we use local static?

632


how can f be used for both float and double arguments in printf? Are not they different types?

602


Under what circumstances does a name clash occur?

682


Write a program that takes a 5 digit number and calculates 2 power that number and prints it(should not use big integers and exponential functions)

5784


Write a function which takes as parameters one regular expression(only ? and * are the special characters) and a string and returns whether the string matched the regular expression.

642


What is page thrashing?

645


What are the disadvantages of a shell structure?

682


How can I pad a string to a known length?

603


Explain the difference between strcpy() and memcpy() function?

583


I have a varargs function which accepts a float parameter?

567