HCL TECHNOLOGIES PLACEMENT PAPERS – TECHNICAL QUESTIONS 15 – 30
PAPER : TECHNICAL QUESTIONS
16. 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
17. Find the output for the following C Program
main()
{
int x,j,k;
j=k=6;x=2;
x=j*k;
printf(“%d”, x);
18. Find the output for the following C Program
fn f(x)
{
if(x<=0)
return;
else if(x-1)+x;
}
19. Find the output for the following C Program
i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
printf(“%d”, k);
ANS: k=4
20. 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
21. 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
22. What is the sizeof(long int)
(a) 4 bytes
(b) 2 bytes
(c) compiler dependent
(d) 8 bytes
23. Which of the function operator cannot be Over Loaded
(a) <=
(b) ?:
(c) =
(d) *
24. Find the output for the following C program
main()
{
intx=2,y=6,z=6;
x=y==z;
printf(%d”,x)
}
25. Find the Output
main()
{
printf(“%d%d”size of (“Hcl
technologies”),strlen(“HCL Technologies”));
}
a)16 16
b)16 17
c)17 17
d)17 16
26. Find the Output
main()
{
char arr[]={ ‘
a’,'b’,'\n’,….}
some more instructions;
}
ANS : 77
27. Find the output
main()
{
int arr[]={0,1,2,3,4)
int *a={arr, arr+1,arr+2,…}
int **p=a;
p++;
SOME INSTRUCTIONS:
}
28. Find the output
void main()
{
int i=5;
printf(“%d”,i++ + ++i);
}
a) 11
b) 12
c) 10
d) output cant be predicted
ANS: D
29.Find the output
main( )
{
int a[2][3][2] = {{{2,4},{7,8},{3,4}},{{2,2},{2,3},{3,4}}};
printf(“%u %u %u %d \n”,a+1,*a+1,**a+1,***a+1);
}
a) 100, 100, 100, 2
b) 101,101,101,2
c) 114,104,102,3
d) None
30.Find the output
main( )
{
static int a[ ] = {0,1,2,3,4};
int *p[ ] = {a,a+1,a+2,a+3,a+4};
int **ptr = p;
ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*ptr++;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
*++ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
++*ptr;
printf(“\n %d %d %d”, ptr-p, *ptr-a, **ptr);
}
ANS : 111 222 333 344
HCL TECHNOLOGIES PLACEMENT PAPERS - TECHNICAL QUESTIONS 15 - 30
0 comments:
Post a Comment