LG Soft Technical and Aptitude Paper Nov 30, 2013
Posted on :11-03-2016
Technical:
Q1. What is the output of the following program?
int a=5;
printf(%d%d%d,a,a<<2,a>>2);
ANS: 5201
Q2.
unsigned int i=10;
while(i>=0)
i--;
How many times the loop will continue in the above program?
Q3. What is the output of the following program?
char a[]=ggfjg;
char b[];
b=a;
printf(%s%s,a,b);
Q4. What is the output of the following program?
int a=10,b=3;
float c;
c=a/b;
printf(%f,c);
Q5. fseek() is used for ----.
Q6. If we loose the head pointer in a linked list, can we free the memory?
Q7. calloc() returns -----
Q8. What is the output of the following program?
main ()
{
struct asd{
struct asf{
int a;
int b;
};
int c;
}x;
}
a. compiler error
b. no error
c. run time error
d. none
ANS: a compiler error
Q9.
struct {
char a;
long i;
char b;
char c;
}n;
How many bytes for the struct in 32 bit compiler?
ANS: 12 bytes
Q10. What is the output of the following program?
int a=1,b=2,c=3;
printf (%d %d, a, b, c);
ANS: 1,2
Q11. What is the output of the following program?
int a=030;
printf (%d, printf (%o, a));
ANS: 242
Q12. What is the output of the following program?
int a[]={0,1,2,3,4};
int *p;
p=a+4;
for(;p>=a;p--)
printf(%d,*p);
}
ANS: 4 3 2 1 0
Q13. What is the output of the following program?
main()
{
int i;
for(i=0;i<5;i++)
printf(%d,prime());
}
prime(){
static int i;
i=0;
return(i++);
}
Q14. What is the output of the following program?
main()
{
char *p;
p=calloc(1,10);
strcpy(p,hello);
test(p);
printf(%s,p);
free(p);
}
test(char *q)
{
free(q);
}
Aptitude:
Q15. A monkey jumps 3feet up and fell down 2ft. Then in how many jumps does it would reach 20 ft?
Q16. A is taller than B,
C is shorter than A,
who is the shorter among B and C?
Q17. 64,16,4, 1/4, 1/16,---- fill the next term.
Q18. Suppose two cars travel from same point in opposite directions and travel 8m, then each car took left and travelled for 6m then what is the distance between the two cars?
ANS: 20
Q19. 4 years ago father was 9 times older than his son. After 2 years father was 40. What is the present age of his son?
Q20. A person eats 100 bananas in 5 days. Each day he eats 6 more bananas, then how many bananas did he ate on the first day?