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

What is the use of #define preprocessor in c?

1063


What are the advantages of union?

1063


What is clrscr in c?

1128


What are the disadvantages of c language?

1184


What is the difference between the = symbol and == symbol?

1103


find the sum of two matrices and WAP for it.

1128


what will be maximum number of comparisons when number of elements are given?

1896


How can I dynamically allocate arrays?

1087


Can we declare a function inside a function in c?

1027


What are the types of data structures in c?

1139


Program will then find the largest of three numbers using nested if-else statements. User is prompted to enter three numbers. Program will find the largest number and display it on the screen. All three numbers entered by the user are also displayed. If user enters 21, 33, and 5, the output should be as follows: You entered: 21, 33 and 5. The largest number is 33.

1670


Explain what is gets() function?

1065


What is a method in c?

1131


What is the hardest programming language?

1138


Explain the difference between call by value and call by reference in c language?

1103