| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| how to return a multiple value from a function? | Wipro | 2 |
| How we will connect multiple client ? (without using
fork,thread) | TelDNA | 2 |
| main()
{
{
unsigned int bit=256;
printf("%d", bit);
}
{
unsigned int bit=512;
printf("%d", bit);
}
}
a. 256, 256
b. 512, 512
c. 256, 512
d. Compile error | HCL | 1 |
| main()
{
int i, j, *p;
i = 25;
j = 100;
p = &i; // Address of i is assigned to pointer p
printf("%f", i/(*p) ); // i is divided by pointer p
}
a. Runtime error.
b. 1.00000
c. Compile error
d. 0.00000 | HCL | 1 |
| main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
} | | 1 |
| #define f(g,g2) g##g2
main()
{
int var12=100;
printf("%d",f(var,12));
} | | 1 |
| main()
{
int a[10];
printf("%d",*a+1-*a+3);
} | | 1 |
| Write a function to find the depth of a binary tree. | Adobe | 8 |
| You are given any character string. Find the number of sets
of vowels that come in the order of aeiou in the given
string. For eg., let the given string be DIPLOMATIC. The
answer returned must be "The number of sets is 2" and "The
sets are "IO and AI". Vowels that form a singleton set must
be neglected. Try to post the program executable in gcc or
g++ or in java. | | 3 |
| main()
{
if ((1||0) && (0||1))
{
printf("OK I am done.");
}
else
{
printf("OK I am gone.");
}
}
a. OK I am done
b. OK I am gone
c. compile error
d. none of the above | HCL | 1 |
| Extend the sutherland-hodgman clipping algorithm to clip
three-dimensional planes against a regular paralleiepiped | IBM | 1 |
| how to return a multiple value from a function? | Wipro | 5 |
| main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
} | | 1 |
| void main()
{
int i=5;
printf("%d",i++ + ++i);
} | | 1 |
| main()
{
int i=5,j=6,z;
printf("%d",i+++j);
} | | 1 |
| main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
} | | 1 |
| print numbers till we want without using loops or condition
statements like specifically(for,do while, while swiches,
if etc)!
| | 7 |
| main()
{
int *j;
{
int i=10;
j=&i;
}
printf("%d",*j);
} | | 1 |
| void main()
{
int i;
char a[]="\0";
if(printf("%s\n",a))
printf("Ok here \n");
else
printf("Forget it\n");
} | | 1 |
| main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
} | | 1 |
| |
| For more C Code Interview Questions Click Here |