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...

write a program to swap Two numbers without using temp variable.

Answer Posted / harisharumalla

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
printf("\n Enter the 2 numbers");
scanf("%d%d",&a,&b);
//swaping of 2 numbers without using temp variable
a=a+b;
b=a-b;
a=a-b;
/* or
a=a*b;
b=a/b;
a=a/b;
*/
printf("\n A = %d \n B = %d\n");
getch();
}

Is This Answer Correct ?    604 Yes 119 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

FORMATTED INPUT/OUTPUT functions are a) scanf() and printf() b) gets() and puts() c) getchar() and putchar() d) all the above

1121


Can stdout be forced to print somewhere other than the screen?

1050


What is the maximum length of an identifier?

1188


What is function prototype in c with example?

1093


a c code by using memory allocation for add ,multiply of sprase matrixes

2807


Write a program of advanced Fibonacci series.

1155


what is the diffrenet bettwen HTTP and internet protocol

1840


What is a structure member in c?

1008


What are the advantages of the functions?

1164


Is array name a pointer?

1035


what are the program that using a two dimensional array that list the odd numbers and even numbers separately in a given 10 inputs values

1702


write a sorting prgm to sort 50 nos and sum them and also remove all the occurrences of 15 and print it?

2139


Can two or more operators such as and be combined in a single line of program code?

1375


Is file a keyword in c?

935


1) There is a singing competition for children going to be conducted at a local club. Parents have been asked to arrive at least an hour before and register their children’s names with the Program Manager. Whenever a participant registers, the Program Manager has to position the name of the person in a list in alphabet order. Write a program to help the Program Manager do this by placing the name in the right place each time the Program Manger enters a name. 2) the Event Manager has to send participants to the stage to perform in the order in which they registered. Write a program that will help the Event Manager know who to call to the stage to perform. The Logic should be in Data Structures

3229