| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| program to find magic aquare using array | HCL | 3 |
| #define FALSE -1
#define TRUE 1
#define NULL 0
main() {
if(NULL)
puts("NULL");
else if(FALSE)
puts("TRUE");
else
puts("FALSE");
} | | 1 |
| program to find the roots of a quadratic equation | HP | 3 |
| Give a very good method to count the number of ones in a 32
bit number.
(caution: looping through testing each bit is not a solution) | Microsoft | 5 |
| What is "far" and "near" pointers in "c"...? | | 3 |
| main()
{
int i=5,j=6,z;
printf("%d",i+++j);
} | | 1 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
} | | 1 |
| 1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations. | | 2 |
| Printf can be implemented by using __________ list. | | 1 |
| #ifdef something
int some=0;
#endif
main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
} | | 1 |
| #define clrscr() 100
main()
{
clrscr();
printf("%d\n",clrscr());
} | | 1 |
| why java is platform independent? | Wipro | 10 |
| main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 |
| void main()
{
int i=5;
printf("%d",i++ + ++i);
} | | 1 |
| how to return a multiple value from a function? | Wipro | 2 |
| char *someFun()
{
char *temp = string constant";
return temp;
}
int main()
{
puts(someFun());
} | | 1 |
| main()
{
printf("%x",-1<<4);
} | | 1 |
| #include<conio.h>
main()
{
int x,y=2,z,a;
if(x=y%2) z=2;
a=2;
printf("%d %d ",z,x);
} | | 1 |
| main()
{
int i=_l_abc(10);
printf("%d\n",--i);
}
int _l_abc(int i)
{
return(i++);
} | | 1 |
| What is wrong with the following code?
int *foo()
{
int *s = malloc(sizeof(int)100);
assert(s != NULL);
return s;
} | | 1 |
| |
| For more C Code Interview Questions Click Here |