HCL Campus Interview Questions & Answers 2012


1. When inorder traversing a tree resulted E A C K F H D B G; the preorder traversal would return
a. FAEKCDBHG
b. FAEKCDHGB
c. EAFKHDCBG
d. FEAKDCHBG

Answer : B

2. Find the output :

main( )
{
int z = 4;
printf( “%d”, printf(“ %d %d “, z, z));
}
a) 4 4 3 b) 4 4 5 c) 4 4 4 d) Error

Answer : B

3. What is the postfix form of the following prefix expression -A/B*C$DE

(A) ABCDE$*/- (B) A-BCDE$*/-
(C) ABC$ED*/- (D) A-BCDE$*/

Ans:A
4. Find the output :

int x= 0x65;
main()
{
char x;
printf(“%d\n”,x)
}

a) compilation error b) ‘A’ c) 65 d) unidentified

Answer : D

5. integer x = 40, y = 35, z = 20, w = 10
Comment abt the o/p of d following two stmnts :print x * y / z – w
print x * y / (z – w)
a. Differ by 80
b. Same
c. Differ by 50
d. Differ by 160

Answer : a
6. Find the output :
main( )
{
int a[ ] = { 10, 20, 30, 40, 50};
int j;
for (j = 0; j < 5; j++)

{
printf(“ \n %d”, * a);
a ++;
}
}
a) 0..5 b) 0..4 c) Error d) None of the aboveAnswer : C

7. main( )
{
int z = 4;
printf( “%d”, printf(“ %d %d “, z, z));
}
a) 4 4 3 b) 4 4 5 c) 4 4 4 d) Error

Answer : b

8. Find the output :

main( )
{
static char str[ ] = { 48, 48, 48, 48, 48, 48, 48, 48, 48, 48};
char *s;
int i;
s = str;
for(i = 0; i <=9; i++)
{
if(*s)
printf(“%c”, *s);
s++;
}
}

a)0 0 0 0 0 0 0 0 0 0 b) 1 1 1 1 1 1 1 1 1 1 c) 48 48 48 48 48 48 48 48 48 48 d) None

Answer : A

9. Find the output :

main()
{
char *p=”hai friends”,*p1;
p1=p;
while(*p!=’\0′)
++*++p;
printf(“%s %s”,p,p1);
}

a. ibj!gsjfoet b. hbj!gsjfoet c. hbj!gsjfoet hbj!gsjfoet d. None

Answer : D

10. Find the output :

#include
main()
{
switch (5)
{
case 5: printf(” 5 “);
default: printf(” 10 “);
case 6: printf(” 6 “);
}
}
A. 5 B. 5 10 6 C. 5 10 D. 5 6

Answer : B

ElamParithi Arul is Editor At Large and the Owner of Tech Twinklers. He is the founder of the Parithi Network. Basically being a 23 year old Whizkid, He's A Mac User. An Adventurer. A Tech Enthusiast, An Avid PC and PlayStation Gamer, A Hobbyist Photographer and a Nature Lover. His basic interests are developing Websites, Apps and coming up with various creative ideas for a better vibrant tomorrow. He is a professional blogger for about 4 years and writes blogs regarding technology, gaming, and about his own personal life. You can follow him on Twitter at @Parithi

You may also like

2 Comments

  • saranraj
    January 2, 2013 at 8:59 PM

    please send for important questions…

  • aishwarya
    October 20, 2013 at 2:31 PM

    plz give link for ece question banks 7th sem

LEAVE A COMMENT

Welcome To TechTwinklers!

Tech Twinklers is a Tech Blog run by Students with an aspiring enthusiasm in Technology and Gaming. This Blog will bring News about the Modern Technology, Educational Advances, Campus Interviews, etc. So make sure you subscribe to our blog because we don't want you to miss a thing that is posted here..

We're on Facebook!