Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Answers were Sorted based on User's Feedback



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

Answer / 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

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

Answer / 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

More C Interview Questions

how many times does the loop iterated ? for (i=0;i=10;i+=2) printf("Hi\n");

9 Answers   TCS,


What is difference between constant pointer and constant variable?

0 Answers   Hexaware,


what is uses of .net

0 Answers  


Can you write the function prototype, definition and mention the other requirements.

0 Answers   Adobe,


What's wrong with the call "fopen ("c:\newdir\file.dat", "r")"?

1 Answers  


What is data structure in c language?

0 Answers  


What is a dynamic array in c?

0 Answers  


What language is lisp written in?

0 Answers  


What is "Duff's Device"?

0 Answers   Celstream,


What will the preprocessor do for a program?

0 Answers   Aspire, Infogain,


What is the right type to use for boolean values in c? Is there a standard type? Should I use #defines or enums for the true and false values?

0 Answers  


How can I trap or ignore keyboard interrupts like control-c?

0 Answers  


Categories