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

#include<stdio.h>
void main()
{
int x,y;
printf("enter x and y");
scanf("%d%d",&x,&y);
x=x+y;
y=x-y;
x=x-y;
printf("elements after swapping :%d,%d",x,y);
}

Is This Answer Correct ?    185 Yes 32 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How many bytes are occupied by near, far and huge pointers (dos)?

1153


What are comments and how do you insert it in a C program?

1240


What is the scope of static variable in c?

1014


what is bit rate & baud rate? plz give wave forms

1976


write a program to generate address labels using structures?

4567


Should I use symbolic names like true and false for boolean constants, or plain 1 and 0?

1054


What are loops c?

1052


What is static memory allocation?

1169


What is the purpose of the statement: strcat (S2, S1)?

1164


which of the following shows the correct hierarchy of arithmetic operations in C a) (), **, * or/,+ or - b) (),**,*,/,+,- c) (),**,/,*,+,- d) (),/ or *,- or +

1727


What are the Advantages of using macro

1163


How can I convert a number to a string?

1159


What is the size of structure in c?

1147


What is difference between static and global variable in c?

1043


Here is a good puzzle: how do you write a program which produces its own source code as output?

1090