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

Two numbers are input through the keyboard into two
locations C and D. Write a program to interchange the
contents of C and D.



#include<stdio.h>

#include<conio.h>
void main( )
{
int a,b,c;
clrscr( );
printf("Enter A: ");
scanf("%d",&a);

printf("Enter B: ");
scanf("%d",&b);

c=a;
a=b;
b=c;

printf("\n The New Value Of A is : %d",a);
printf("\n The New Value Of B is : %d",b);


getch();
}

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

show how link list can be used to repersent the following polynomial i) 5x+2

2294


What is string function in c?

979


Tell us two differences between new () and malloc ()?

1183


How to establish connection with oracle database software from c language?

2197


What are nested functions in c?

1014


What is a file descriptor in c?

1127


what are the advantages of a macro over a function?

1141


What are two dimensional arrays alternatively called as?

1177


Write a program to generate random numbers in c?

1095


Explain what is gets() function?

1069


What is the purpose of main() function?

1243


Do you know the use of 'auto' keyword?

1191


Tell us something about keyword 'auto'.

1070


What are local variables c?

1012


Explain can the sizeof operator be used to tell the size of an array passed to a function?

1066