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 interchange two variables without using
the third variable?

Answer Posted / genius

#include <stdio.h>
#include <conio.h>
main()
{
int a,b,temp;
clrscr();
printf("enter two numbers:");
scanf("%d,%d",&a,&b);
printf("values of a and b are %d,%d \n",a,b);
temp=a;
a=b;
b=temp;
printf("swapped values of a and b are %d,%d", a,b);
getch();
}

Is This Answer Correct ?    4 Yes 6 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain what are the different data types in c?

1225


What is %lu in c?

1261


Why do we use namespace feature?

1059


What is the purpose of macro in C language?

1127


Distinguish between actual and formal arguments.

1087


What is void pointers in c?

1010


Can you write the algorithm for Queue?

2125


Why do we use & in c?

1006


What do the functions atoi(), itoa() and gcvt() do?

1195


How do you use a pointer to a function?

1090


define string ?

1113


Is null always equal to 0(zero)?

1037


What is the explanation for prototype function in c?

987


What should malloc(0) do?

1127


What is ponter?

1269