Powered By Blogger

Friday, August 12, 2011

Samsung Interview Questions


1. Value of EOF??
Ans: - 1
2.struct abc
{
};
struct abc arr[10];
struct abc *p=arr;
Which statement will  increment the pointer to point the next array element?
Ans:- p=p+sizeof(abc);
4.char *a=”hello\0world\0!!”;
printf(“%d”,strlen(a));
a=a+6;
printf(“%d”,strlen(a));
a=a+7;
printf(“%d”,strlen(a));
Ans : 5 5 1 
5.int i=0;
For(;i++;printf(“%d”,i));
printf(“%d”,i);
Ans:1
6.static int i;
main()
{
If(i==5)
printf(“Samsung”);
i++;
return(i=main());
}
Ans: Stack Overflow
8.int *b={1,2,3,4,5,6,9,8};
printf(“%d”,(b+1)[5]);
Ans: 9

9.int i=512;
char *c=(char *)&i;
c[0]=1;
printf(%d”,i);
Ans: 513;
10.enum={black=2,Green=7,Red};
printf(“%d %d %d”,black,green,red}
Ans: 2 7 8
11.class abc
{
};
abc ob;
cout<
Ans: 1;
12.class abc
{
static int i;
int a;
};
abc ob;
cout<cout<
13.char c=’a’;
printf(“%d %d %d”,size(c),size(‘a’),size(“A”);
Ans: 1 4 2;
14.int i=5,*j;
void *k;
k=j=&I;
printf(“%d”,k+1);
Ans: Compilation error (but its running on gnu);
15.int i=0;
switch(i)
{
printf(“samsung”);
case 10:printf(“some string”);
break;
case 5*2:printf(“some string”);
break;
}
Ans: Error Due to Conflicting Case;
16.#define true 1
#define false -1
#define null 0
if(null)
printf(“……”);
else if(false)
printf(“true”);
Ans: True;

Data Structure :-
1.Property of Heap?
Ans: Every Node is Greater Than its Child;
2.Complexity of Binary.Log n;

Operating System :-
1.On Switch on the Computer Which Loader Come in Action First.
Ans: Boot Strap Loader
2.How to Decrease The Page Fault.
Ans :  locality of reference

Wednesday, August 10, 2011

Apology...

Sorry guys...my xams were going so cudn't post more program at that time...however i am back now..so the posting session will continue....njoy and post any C program problem that u face !!

Regards,
Parag Kr. Acharyya