HCL Placement Paper Technical written test section:
Multiple choice questions for finding out the C language program errors and output after execution, sample c language programs for technical IT graduates, computer science engineering cse, Btech be IT information technology jobs, recruitment tests at leading MNC firms.
Given the following statement enum day = { jan = 1 ,feb=4, april, may} What is the value of may?
(a) 4
(b) 5
(c) 6
(d) 11
(e) None of the above
Find the output for the following C program
main()
{int x,j,k;
j=k=6;x=2;
x=j*k;
printf(“%d”, x);
Find the output for the following C program
fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
Find the output for the following C program
i=20,k=0;
for(j=1;j {k+=j<10?4:3;
}
printf(“%d”, k);
Ans. k=4
Find the output for the following C program
int i =10
main()
{
int i =20,n;
for(n=0;n<=i;)
{
int i=10;
i++;
}
printf(“%d”, i);
Ans. i=20
Find the output for the following C program
int x=5;
y= x&y
Find the output for the following C program
Y=10;
if( Y++>9 && Y++!=10 && Y++>10)
{printf(“%d”, Y);
else
printf(“%d”, Y);
}
Ans. 13
Find the output for the following C program
f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
Ans. (a)
What is the sizeof(long int)
(a) 4 bytes
(b) 2 bytes
(c) compiler dependent
(d) 8 bytes
Which of the function operator cannot be over loaded
(a) <=
(b) ?:
(c) =
(d) *
Find the output for the following C program
main()
{intx=2,y=6,z=6;
x=y==z;
printf(%d”,x)
}
To attend HCL papers, one has to be strong in basic C concepts. A good book like “Let us C” from Yashwant Kanitkar should help a lot.
Also practicing online placement papers could help a lot. Practicing should come hand in hand along with reading solved papers.