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 many ways are there to swap two numbers without using
temporary variable? Give the each logic.

Answer Posted / gana samantula

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf(" Enter the first No.:");
scanf("%d",&a);
printf(" Enter the second No.:");
scanf("%d",&b);
b=a+b-(a=b);
printf(" the swap of a and b numbers :%d %d",a,b);

getch();
}

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

i have a written test for microland please give me test pattern

2721


How can I delete a file?

1051


Is it possible to use curly brackets ({}) to enclose single line code in c program?

1300


What are the functions to open and close file in c language?

1187


What are qualifiers?

1027


What are the __date__ and __time__ preprocessor commands?

1092


What is a stream?

1122


a) Identify the following declarations. Ex. int i (integer variable) float a[l0](array of 10 real nos) int (*f())() void *f int (*f()) [] void *f int f[] [] [] char *(*f) () int (*f[]) [] float(*f) [] [] float **f int ******f

2136


When is a “switch” statement preferable over an “if” statement?

1132


Explain with the aid of an example why arrays of structures don’t provide an efficient representation when it comes to adding and deleting records internal to the array.

3131


given post order,in order construct the corresponding binary tree

2763


What is operator precedence?

1187


If null and 0 are equivalent as null pointer constants, which should I use?

1194


What is wrong in this statement? scanf(“%d”,whatnumber);

1217


What are the storage classes in C?

1151