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

Answer Posted / rajitha

#include<stdio.h>
main()
{
int a=3,b=4;
b=a+b-(a=b);
printf("%d",a);
printf("%d",b);
}

Is This Answer Correct ?    19 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain enumerated types in c language?

606


Explain what could possibly be the problem if a valid function name such as tolower() is being reported by the c compiler as undefined?

585


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

981


Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?

580


Explain the use of function toupper() with and example code?

655






Why c language is called c?

571


i have to apply for rbi before that i need to know the the syllabus for the entrance questions. whethet it may be aps or techinical

1844


Given two strings S1 and S2. Delete from S2 all those characters which occur in S1 also and finally create a clean S2 with the relevant characters deleted.

837


i = 25;switch (i) {case 25: printf("The value is 25 ");case 30: printf("The value is 30 "); When the above statements are executed the output will be : a) The value is 25 b) The value is 30 c) The value is 25 The value is 30 d) none

648


Disadvantages of C language.

663


Explain what is output redirection?

669


What is an arrays?

656


Why c is faster than c++?

634


Explain what is the difference between text files and binary files?

619


What is a const pointer?

638