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 is nested structure in c?

1079


What are linked lists in c?

1134


Who developed c language and when?

1074


Describe newline escape sequence with a sample program?

1128


What is difference between static and global variable in c?

1067


Explain what’s a signal? Explain what do I use signals for?

1169


Why is c so important?

1070


How can I make sure that my program is the only one accessing a file?

1289


Why is c called a mid-level programming language?

1213


What are pointers? What are different types of pointers?

1156


how could explain about job profile

1930


Is fortran still used today?

1101


What is the difference between declaring a variable and defining a variable?

1290


Which is better malloc or calloc?

1111


Write a program in c to replace any vowel in a string with z?

1137