| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Give a one-line C expression to test whether a number is a
power of 2. | Microsoft | 8 |
| char inputString[100] = {0};
To get string input from the keyboard which one of the
following is better?
1) gets(inputString)
2) fgets(inputString, sizeof(inputString), fp) | | 1 |
| programming in c lanugaue programm will errror error with
two header file one as stdio.h and other one is conio.h | | 1 |
| Write out a function that prints out all the permutations of
a string.
For example, abc would give you abc, acb, bac, bca, cab,
cba. You can assume that all the characters will be unique. | Microsoft | 4 |
| main()
{
while (strcmp(“some”,”some\0”))
printf(“Strings are not equal\n”);
} | | 1 |
| write the function. if all the character in string B appear in
string A, return true, otherwise return false. | Google | 10 |
| Derive expression for converting RGB color parameters to
HSV values | | 1 |
| Finding a number which was log of base 2 | NetApp | 1 |
| main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
} | | 1 |
| main()
{
int i;
printf("%d",scanf("%d",&i)); // value 10 is given as
input here
} | | 1 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
} | | 1 |
| Sorting entire link list using selection sort and insertion
sort and calculating their time complexity | NetApp | 1 |
| main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
} | | 1 |
| main()
{
printf("%d, %d", sizeof('c'), sizeof(100));
}
a. 2, 2
b. 2, 100
c. 4, 100
d. 4, 4 | HCL | 3 |
| main()
{
extern out;
printf("%d", out);
}
int out=100; | | 1 |
| main()
{
char name[10],s[12];
scanf(" \"%[^\"]\"",s);
}
How scanf will execute? | | 1 |
| Write a program that find and print how many odd numbers in
a binary tree | | 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 |
| void main()
{
int i;
char a[]="\0";
if(printf("%s\n",a))
printf("Ok here \n");
else
printf("Forget it\n");
} | | 1 |
| Finding a number multiplication of 8 with out using
arithmetic operator | NetApp | 8 |
| |
| For more C Code Interview Questions Click Here |