| Other C Code Interview Questions |
| | | Question | Asked @ | Answers | | | | main()
{
printf("\nab");
printf("\bsi");
printf("\rha");
} | | 1 | | main()
{
extern int i;
i=20;
printf("%d",sizeof(i));
} | | 1 | | main()
{
char p[ ]="%d\n";
p[1] = 'c';
printf(p,65);
} | | 1 | | Link list in reverse order. | NetApp | 7 | | main()
{
int i=10,j=20;
j = i, j?(i,j)?i:j:j;
printf("%d %d",i,j);
} | | 1 | | main()
{
signed int bit=512, i=5;
for(;i;i--)
{
printf("%d\n", bit = (bit >> (i - (i -1))));
}
}
a. 512, 256, 128, 64, 32
b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4 | HCL | 1 | | main()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above | HCL | 1 | | void main()
{
int const * p=5;
printf("%d",++(*p));
} | | 1 | | main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
} | | 1 | | what will be the position of the file marker?
a: fseek(ptr,0,SEEK_SET);
b: fseek(ptr,0,SEEK_CUR); | | 1 | | What are the following notations of defining functions known as?
i. int abc(int a,float b)
{
/* some code */
}
ii. int abc(a,b)
int a; float b;
{
/* some code*/
} | | 1 | | Given a list of numbers ( fixed list) Now given any other
list, how can you efficiently find out if there is any
element in the second list that is an element of the
first list (fixed list) | Disney | 3 | | int i;
main(){
int t;
for ( t=4;scanf("%d",&i)-t;printf("%d\n",i))
printf("%d--",t--);
}
// If the inputs are 0,1,2,3 find the o/p | | 1 | | main()
{
char c=' ',x,convert(z);
getc(c);
if((c>='a') && (c<='z'))
x=convert(c);
printf("%c",x);
}
convert(z)
{
return z-32;
} | | 1 | | main()
{
signed int bit=512, mBit;
{
mBit = ~bit;
bit = bit & ~bit ;
printf("%d %d", bit, mBit);
}
}
a. 0, 0
b. 0, 513
c. 512, 0
d. 0, -513 | HCL | 1 | | Derive expression for converting RGB color parameters to
HSV values | | 1 | | int swap(int *a,int *b)
{
*a=*a+*b;*b=*a-*b;*a=*a-*b;
}
main()
{
int x=10,y=20;
swap(&x,&y);
printf("x= %d y = %d\n",x,y);
} | | 1 | | main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
} | | 1 | | main()
{
int i =10, j = 20;
clrscr();
printf("%d, %d, ", j-- , --i);
printf("%d, %d ", j++ , ++i);
}
a. 20, 10, 20, 10
b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10 | HCL | 1 | | main()
{
int i=_l_abc(10);
printf("%d\n",--i);
}
int _l_abc(int i)
{
return(i++);
} | | 1 | | | | For more C Code Interview Questions Click Here |
|