| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
int i;
i = abc();
printf("%d",i);
}
abc()
{
_AX = 1000;
} | | 1 |
| Write a function to find the depth of a binary tree. | Adobe | 8 |
| write the function. if all the character in string B appear in
string A, return true, otherwise return false. | Google | 10 |
| How do you write a program which produces its own source
code as its output?
| | 7 |
| Is the following code legal?
typedef struct a
{
int x;
aType *b;
}aType | | 1 |
| main()
{
float f=5,g=10;
enum{i=10,j=20,k=50};
printf("%d\n",++k);
printf("%f\n",f<<2);
printf("%lf\n",f%g);
printf("%lf\n",fmod(f,g));
} | | 1 |
| main()
{
int i = 0xff ;
printf("\n%d", i<<2);
}
a. 4
b. 512
c. 1020
d. 1024 | HCL | 1 |
| void main()
{
if(~0 == (unsigned int)-1)
printf(“You can answer this if you know how values are
represented in memory”);
} | | 1 |
| void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
} | | 1 |
| What is the output for the following program
main()
{
int arr2D[3][3];
printf("%d\n", ((arr2D==* arr2D)&&(* arr2D ==
arr2D[0])) );
} | | 1 |
| Write a program that find and print how many odd numbers in
a binary tree | | 1 |
| main()
{
int i=10;
void pascal f(int,int,int);
f(i++,i++,i++);
printf(" %d",i);
}
void pascal f(integer :i,integer:j,integer :k)
{
write(i,j,k);
} | | 1 |
| main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
} | | 1 |
| void main()
{
int *mptr, *cptr;
mptr = (int*)malloc(sizeof(int));
printf(“%d”,*mptr);
int *cptr = (int*)calloc(sizeof(int),1);
printf(“%d”,*cptr);
} | | 1 |
| Find your day from your DOB? | Microsoft | 12 |
| Is the following code legal?
void main()
{
typedef struct a aType;
aType someVariable;
struct a
{
int x;
aType *b;
};
} | | 1 |
| how to return a multiple value from a function? | Wipro | 5 |
| main()
{
int i;
float *pf;
pf = (float *)&i;
*pf = 100.00;
printf("\n %d", i);
}
a. Runtime error.
b. 100
c. Some Integer not 100
d. None of the above | HCL | 1 |
| #include<stdio.h>
main()
{
register i=5;
char j[]= "hello";
printf("%s %d",j,i);
} | | 1 |
| How we print the table of 3 using for loop in c
programing? | | 3 |
| |
| For more C Code Interview Questions Click Here |