| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 |
| Is the following code legal?
struct a
{
int x;
struct a *b;
} | | 1 |
| main()
{
clrscr();
}
clrscr(); | | 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 |
| main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
} | | 1 |
| void main()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
} | | 1 |
| Given only putchar (no sprintf, itoa, etc.) write a routine
putlong that prints out an unsigned long in decimal. | | 5 |
| Write a routine that prints out a 2-D array in spiral order | Microsoft | 2 |
| Is this code legal?
int *ptr;
ptr = (int *) 0x400; | | 1 |
| plz send me all data structure related programs | | 2 |
| 1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations. | | 2 |
| Program to find the largest sum of contiguous integers in
the array. O(n) | | 7 |
| void ( * abc( int, void ( *def) () ) ) (); | | 1 |
| int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
} | | 1 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
} | | 1 |
| main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
} | | 1 |
| main()
{
static char
names[5][20]={"pascal","ada","cobol","fortran","perl"};
int i;
char *t;
t=names[3];
names[3]=names[4];
names[4]=t;
for (i=0;i<=4;i++)
printf("%s",names[i]);
} | | 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 |
| Program to Delete an element from a doubly linked list.
| Infosys | 4 |
| What is the hidden bug with the following statement?
assert(val++ != 0); | | 1 |
| |
| For more C Code Interview Questions Click Here |