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 TO SWAP TWO NOS IN ONE STEP?

Answer Posted / amaresh chandra das

amaresh@Hare-Krishna:~$ cat swp.c
#include<stdio.h>
int
main(){
int a=5,b=6; // Compile using gcc -Wall
#ifdef DEBUG // to avoid compiler warnings
a ^=b^=a^=b;
#endif
printf("value of a is %d and b is %d\n",a,b);
return 0;
}

Is This Answer Correct ?    2 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is FIFO?

1712


What are header files and what are its uses in C programming?

1237


A program is required to print your biographic information including: Names, gender, student Number, Cell Number, line of study and your residential address.

1718


Given below are three different ways to print the character for ASCII code 88. Which is the correct way1) char c = 88; cout << c << " ";2) cout.put(88);3) cout << char(88) << " "; a) 1 b) 2 c) 3 d) constant

1155


Explain what are header files and explain what are its uses in c programming?

1159


Synonymous with pointer array a) character array b) ragged array c) multiple array d) none

1067


What are the application of c?

1102


Which of the following operators is incorrect and why? ( >=, <=, <>, ==)

1166


What is LINKED LIST? How can you access the last element in a linked list?

1071


What are identifiers in c?

1202


cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration

1106


What the different types of arrays in c?

1069


Which one would you prefer - a macro or a function?

1083


Explain argument and its types.

1062


Write the program with at least two functions to solve the following problem. The members of the board of a small university are considering voting for a pay increase for their 10 faculty members. They are considering a pay increase of 8%. Write a program that will prompt for and accept the current salary for each of the faculty members, then calculate and display their individual pay increases. At the end of the program, print the total faculty payroll before and after the pay increase, and the total pay increase involved.

3110