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

#include<stdio.h>
int main()
{
int a,b;
printf("Enter values for a,b\n");
scanf("%d %d",&a,&b);

b = b+a;
a= b-a;
b=b-a;
printf("a = %d,b = %d",a,b);

}

Is This Answer Correct ?    18 Yes 11 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Using functions, write a program that multiplies two arrays. Use the following functions: - Function ReadArray - Function MultiplyArrays - Function DisplayArrays

2346


Explain the difference between malloc() and calloc() in c?

1042


Differentiate between static and dynamic modeling.

1103


What is an lvalue in c?

1122


What are qualifiers in c?

1032


Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]

1075


main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }

1151


What is difference between constant pointer and constant variable?

1299


if a is an integer variable, a=5/2; will return a value a) 2.5 b) 3 c) 2 d) 0

1942


Which programming language is best for getting job 2020?

1048


Do you know pointer in c?

1042


In c programming language, how many parameters can be passed to a function ?

1106


Can a pointer be null?

1021


How can you allocate arrays or structures bigger than 64K?

1132


Write a program to reverse a linked list in c.

1118