| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| void ( * abc( int, void ( *def) () ) ) (); | | 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 |
| program to Reverse a linked list | Ness-Technologies | 4 |
| Declare an array of N pointers to functions returning
pointers to functions returning pointers to characters? | | 1 |
| main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
} | | 1 |
| Which version do you prefer of the following two,
1) printf(“%s”,str); // or the more curt one
2) printf(str); | | 1 |
| main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("\n %u %u ",j,k);
} | | 1 |
| What is the hidden bug with the following statement?
assert(val++ != 0); | | 1 |
| main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
} | | 1 |
| void main()
{
int const * p=5;
printf("%d",++(*p));
} | | 1 |
| What are segment and offset addresses? | Infosys | 1 |
| main()
{
show();
}
void show()
{
printf("I'm the greatest");
} | | 1 |
| how to delete an element in an array
| | 1 |
| How to access command-line arguments? | | 4 |
| main()
{
int i, n;
char *x = “girl”;
n = strlen(x);
*x = x[n];
for(i=0; i<n; ++i)
{
printf(“%s\n”,x);
x++;
}
} | | 1 |
| main()
{
char *p;
p="%d\n";
p++;
p++;
printf(p-2,300);
} | | 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 |
| main()
{
char *p = “ayqm”;
char c;
c = ++*p++;
printf(“%c”,c);
} | | 1 |
| What are the following notations of defining functions known as?
i. int abc(int a,float b)
{
/* some code */
}
ii. int abc(a,b)
int a; float b;
{
/* some code*/
} | | 1 |
| to remove the repeated cahracter from the given caracter
array.
i.e..,
if the input is SSAD
output should of
SAD | Synergy | 6 |
| |
| For more C Code Interview Questions Click Here |