Hai to all , this is mahesh , today we have given lg soft company written exam . total 83 members attended the exam , the cut off was 60% through out the academic career , the pattern is , one written exam , two technical rounds , one hr . written test contains 45 c language bits and 15 aptitude questions. Total 60 marks , duration is one hour.total 40 members cleared the exam . some of the questions are given below ,
C-LANGUAGE BITS :
All bits are based on basics , totally not tough technical paper .just time management ,
I have given some answers for some , as for I know , don,t completely demand on that , i.e questions r correct , answers are some r correct and some r partly correctly.
1.#include
void main()
{
char *p="the";
char *pp="hai";
int o=strcat(p,pp);
printf("\n%d",o);
}
ANS :
Run time error
No complile error
2.#include
void main()
{
int a[4]={123,2,3,4};
char *p;
p=a;
printf("\n%d",*((int*)p+1));
}
ANS :
o/p is 2 . because in printf statement char pointer increments and converted to integer pointer and prints the value in the addrees i.e 2
3.#include
void main()
{
int a[5]={111,222,333,444,555};
int *p=a;
int *pp=p;
printf("\n%d",*(pp+3));
}
ANS :
444
4. struct {
char a;
char m;
int i;
char *p;
char b;
char c;
}n;
how many bytes for the struuct in 32 bit compiler
(hint : it hav padding concept)i.e among all highest data item is int which takes 4 bytes , so complier allocates memory in multiples of 4 .for first two chars occupy 2 bytes , and next 2 bytes of free memory and next 5-8 for integer , 9-12 pointer , 13-14 last two chars and 15-16 according to structure padding
ans :16 bytes
5.printf("%d",-1AP
ANS :- c
8.ANOTHER QUESTION on ages simple one.
9.venky in a class is 45 th good , 46 bad person total how many students in class.
ans: 90 students
10.
Find out Odd diagram from four diafgrams
11.
Water in glass then which of the following is the corresponding one
Mail
Envelope
Book
Pen
Ans: I to dint understand the question
12.remaining four bits r from reasoning like data interpretation. And ...