HP PLACEMENT PAPERS -------- Placement Paper 1

Answer Posted / akshatha shetty

# 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: 10 0 0
b'coz swap(i,j) replaced wid the #define code,
temp=a;
a=b;
b=temp;
since if condition is false t skips first line..
so a=10, b=0, temp=0;

Is This Answer Correct ?    3 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

why didn't get placed so far?

1190


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

1394


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?

592


what is placement paper?

2148


what is the use of air in gc

1433






what you will do when you struck in traffic ?

1046


If anybody knows the recruitment procedure of IOTL & POWER MECHANICAL. send me the placement papers if u hav... very urgent ...

3894


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

1190


your project to describe and tell about : 1. My favorite things 2. My favorite places at home 3. Animals *Choose one of them to describe *Write on your paper *If you done, Send me *Did you get it

784


Recently conducted Apptitude test

1409


email me previous question papers of bob bank for po exams

2059


aptitude

694


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

1293


Do we have vacancy for HR RECRUITER ?

1376


Sks Microfinance

978