How to write the code of the program to swap two numbers
with in one statement?

Answer Posted / manoj kumar shukla

main()
{
int a=4,b=3;
a=a+b-(b=a);
printf("%d",a);
printf("%d",b);
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the advantages of c preprocessor?

714


What is calloc in c?

664


In C language, a variable name cannot contain?

745


Is printf a keyword?

762


Can you explain what keyboard debouncing is, and where and why we us it? please give some examples

1662






7-Given an index k, return the kth row of the Pascal's triangle. For example, when k = 3, the row is [1,3,3,1]. For reference look at the following standard pascal’s triangle.

2222


how to introdu5ce my self in serco

1523


Given only putchar (no sprintf, itoa, etc.) write a routine putlong that prints out an unsigned long in decimal. [ I gave the obvious solution of taking % 10 and / 10, which gives us the decimal value in reverse order. This requires an array since we need to print it out in the correct order. The interviewer wasn't too pleased and asked me to give a solution which didn't need the array ].

647


What are Macros? What are its advantages and disadvantages?

649


how should functions be apportioned among source files?

627


to find the closest pair

1824


What is linear search?

678


What is break statement?

633


What is the -> in c?

586


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1214