Placement Papers - Caritor

Caritor Solutions
CARITOR PAPER PATTERN PART - 1
Posted by :
Prakash JCET
(8)
Bob Technologies placement paper 1  
PAPER : CARITOR PAPER PATTERN PART - 1
 
 
 CARITOR SERVICES INDIA PVT LIMITED
  
 C QUESTIONSL:-
  1.struct x
 {
int I;
char s;
}
union
{
struct x,y;
double j
}z;
main()
{
printf("%d",sizeof (union z));
 
 
 2.struct x
 {
int I;
short int j;
char a;
char b;
}
struct y
}
main()
{
printf("%d%d",sizeof(structx),sizeof(structy));
}
Ans
12 12
12 8
12 8
8 12
 
 3.main()
 {
int I=0;
}
declaration
definition
 
 4.main()
 {
int I=1234.567
printf("%d",I)
}
 
Ans
1234
1235
1234.567
error
 
 
 5.main()
 {
int *+j
int *I=6;
if(NULL!=&&NULL!=*I)
printf(" ");
}
 
 
 6.main()
 {
int a[]={\'1\',\'2\',\'3\',0,\'1\',\'2\',\'3\'}
printf("%s",a);
Ans
123
1230123
error
 
 
 7.main()
 {
#define x 10
{
printf("%d",++x);
}
Ans
compilation error
run time error
10
11
 
 8.main()
 {
char a[]=("ABCxyz");
printf("%d",sizeof(a));
Ans
26
27
25
 
 9.main()
 {
char a[] ="abcxyz",
char *x;
p=a;
printf("%d",sizeof(*p));
p=p+10;
printf("%d",sizeof(a);
Ans
26,26
26,16
16,26
 
 
 10.main()
 {
int x=1111;
printf("%d",x);
}
Ans
0
 
 11.main()
 {
int i=(int*)0x1000;
printf(\'%d",I);
Ans
1000
compilation error
runtime error
 
 12.main(int I)
 {
printf("%d",I)
}
Ans
error
12
 
 13.main(int arg c)
 int I,j=0;
{
for(I=0;I 
j=j+.(argv(I))
printf("%d",j);
}
Ans
123
error
6
 
 14.main()
 {
printf("%d",printf("helloworld"));
}
 
Ans
13
hello world
hello world 13
error
 
 15.main()
 {
int a[2][2][6]
{{2,3,4,5,6,7}
{.}}
printf("%u%u%u%u",a,*a,**a,***a);
 
assume base address is 567895
Ans
 
567895, 567895, 567895,2
 
 16.main()
 {
a[2][2]={{2},{3}}
printf("%d",a[0][0]);
printf("%d",a[0][1]);
printf("%d",a[1][0])
printf("%d",a[1][1]);
}
Ans
2000
2300
2030
2003
 
QUANTS
 
A- if statements is partly right
B- if statements is partly wrong
C- if no conclusion can be made
first 6 questions from data interpretation
last 5 questions on what comes next