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...

How many ways are there to swap two numbers without using
temporary variable? Give the each logic.

Answer Posted / gana samantula

#include<stdio.h>
#include<conio.h>
void main()
{
int a,b;
clrscr();
printf(" Enter the first No.:");
scanf("%d",&a);
printf(" Enter the second No.:");
scanf("%d",&b);
b=a+b-(a=b);
printf(" the swap of a and b numbers :%d %d",a,b);

getch();
}

Is This Answer Correct ?    14 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

An arrangement of information in memory in such a way that it can be easily accessed and processed by a programming language a) string b) data structure c) pointers d) array

1089


What is the best way of making my program efficient?

962


What is the use of in c?

947


How are variables declared in c?

1028


How is a macro different from a function?

1118


What is quick sort in c?

1021


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

1054


Difference between Function to pointer and pointer to function

1019


main() { printf("hello"); fork(); }

1148


Tell me when would you use a pointer to a function?

1011


how to execute a program using if else condition and the output should enter number and the number is odd only...

2207


What is the time and space complexities of merge sort and when is it preferred over quick sort?

1013


Explain what is meant by high-order and low-order bytes?

999


Write a c program to demonstrate character and string constants?

2114


Is c is a procedural language?

1034