| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| #include<stdio.h>
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
} | | 1 |
| int i=10;
main()
{
extern int i;
{
int i=20;
{
const volatile unsigned i=30;
printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
} | | 1 |
| What is "far" and "near" pointers in "c"...? | | 3 |
| main()
{
int i;
clrscr();
for(i=0;i<5;i++)
{
printf("%d\n", 1L << i);
}
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16 | HCL | 1 |
| How to swap two variables, without using third variable ? | HCL | 47 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 4 |
| #if something == 0
int some=0;
#endif
main()
{
int thing = 0;
printf("%d %d\n", some ,thing);
} | | 1 |
| Is the following code legal?
struct a
{
int x;
struct a b;
} | | 1 |
| To Write a C program to remove the repeated characters in
the entered expression or in entered characters(i.e)
removing duplicates. | Synergy | 2 |
| how to return a multiple value from a function? | Wipro | 2 |
| How to access command-line arguments? | | 4 |
| Derive expression for converting RGB color parameters to
HSV values | | 1 |
| Extend the sutherland-hodgman clipping algorithm to clip
three-dimensional planes against a regular paralleiepiped | IBM | 1 |
| main()
{
unsigned char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 |
| to remove the repeated cahracter from the given caracter
array.
i.e..,
if the input is SSAD
output should of
SAD | Synergy | 6 |
| struct point
{
int x;
int y;
};
struct point origin,*pp;
main()
{
pp=&origin;
printf("origin is(%d%d)\n",(*pp).x,(*pp).y);
printf("origin is (%d%d)\n",pp->x,pp->y);
} | | 1 |
| void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} | | 1 |
| void main()
{
int i=5;
printf("%d",i++ + ++i);
} | | 1 |
| what will be the position of the file marker?
a: fseek(ptr,0,SEEK_SET);
b: fseek(ptr,0,SEEK_CUR); | | 1 |
| main()
{
void swap();
int x=10,y=8;
swap(&x,&y);
printf("x=%d y=%d",x,y);
}
void swap(int *a, int *b)
{
*a ^= *b, *b ^= *a, *a ^= *b;
} | | 1 |
| |
| For more C Code Interview Questions Click Here |