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

HP PLACEMENT PAPERS -------- Placement Paper - 2

Answer Posted / dharati

3 # define swap(a,b) temp=a; a=b; b=temp;
main( )
{
int i, j, temp;
i=5;
j=10;
temp=0;
if( i > j)
swap( i, j );
printf( "%d %d %d", i, j, temp);
}
Ans: On compiling i got ans 10, 0, 0. I did not
understand the concept. Please
expalin this to me.
its because macro is expanded as

temp = i;
i = j;
j = temp;

the condition gets false as i < j and first statement i.e.
temp = a is not executed and remaining statements gets
executed and results in i = 10 and j = 0.

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

what is the use of air in gc

1947


how did you celebrate your last birthday?

1884


email me previous question papers of bob bank for po exams

2554


printf("%d",printf("%d",printf("%d",printf("%s","ILOVECPROGRAM")))); whats the output

2023


HI SIR I WANT PREVIOUS QUESTION PAPER OF HPCL I M CHEMICAL ENGG.

2445


what is difference between uv and visible spectroscopy and how to differentiate the drug compounds in uv visible region

2195


What were the occupations of the people who lived within the Mauryan Empire?

1206


A frog wants to climb a pole which is 15 feet in height, frog can jump 3 feet every minute after which he rests for a minute where he slips down 2 feet. How much time will the frog take to reach the top of the pole?

1132


my question is : reverse a string in COBOL program (please write a code asap) input file: 1234abcdef abc*$#1___ cdef____ghi a_z_k_h___ 4_3_2_1___ ______5678 output file: 8765_____ 1_2_3_4__ h_k_z_a__ ihg____ghi 1#$*cba__ fedcb4321

1831


i want the sample placement paper of goldman sachs urgently. please send it to me

4474


Zero setting of sejong rottary press

1789


aptitude

1190


What kind of Issues/bugs arise in ETL projects? I would like to know few issues (critical to somewhat bugs ) normally occur in ETL process especially when testing? Domains can be banking, retail or any.

1969


speak 1min on topic Travelling,memorable moment ,memorable day?

2322


Give me Medha Sevo previous written test question papers

1957