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 / ram thilak.p

#include<stdio.h>
#include<conio.h>

void main()
{
int a,b,*p1,*p2;
clrscr();
printf("\n\n\t Enter The Values Of A and B:");
scanf("%d %d",&a,&b);
*p1=a;
*p2=b;
b=*p1;
a=*p2;
printf("\n\n\t The Values Of Elements After Swapping Is:%d %d",a,b);
getch();
}

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What does c mean before a date?

1146


How can you tell whether two strings are the same?

1224


What is printf () in c?

1033


Explain the bubble sort algorithm.

1016


Can you please explain the difference between malloc() and calloc() function?

1075


formula to convert 2500mmh2o into m3/hr

958


How can I call a function with an argument list built up at run time?

1194


What is clrscr in c?

1102


How are Structure passing and returning implemented by the complier?

1138


is it possible to create your own header files?

1071


Does c have enums?

1054


What are operators in c?

994


Explain what are compound statements?

1015


How can I recover the file name given an open stream?

978


The number of bytes of storage occupied by short, int and long are a) 2, 2 and 4 b) 2, 4 and 4 c) 4, 4 and 4 d) none

1211