| Other C Code Interview Questions |
| |
| Question |
Asked @ |
Answers |
| |
| main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} |
| 1 |
| main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
} |
| 1 |
| Write a routine that prints out a 2-D array in spiral order |
Microsoft | 3 |
| how many processes will gate created execution of
--------
fork();
fork();
fork();
--------
Please Explain...
Thanks in advance..! |
GATE | 8 |
| main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
} |
| 1 |
| What is the problem with the following code segment?
while ((fgets(receiving array,50,file_ptr)) != EOF)
; |
| 1 |
| main()
{
int k=1;
printf("%d==1 is ""%s",k,k==1?"TRUE":"FALSE");
} |
| 1 |
| int main()
{
int x=10;
printf("x=%d, count of earlier print=%d",
x,printf("x=%d, y=%d",x,--x));
getch();
}
==================================================
returns error>> ld returned 1 exit status
===================================================
Does it have something to do with printf() inside another
printf(). |
| 2 |
| #include<stdio.h>
void fun(int);
int main()
{
int a;
a=3;
fun(a);
printf("\n");
return 0;
}
void fun(int i)
{
if(n>0)
{
fun(--n);
printf("%d",n);
fun(--n);
}
} the answer is 0 1 2 0..someone explain how the code is
executed..? |
Wipro | 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 |
| How to return multiple values from a function?
|
| 7 |
| What is the hidden bug with the following statement?
assert(val++ != 0); |
| 1 |
| |
| For more C Code Interview Questions Click Here |