| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
} | | 1 |
| Write a routine that prints out a 2-D array in spiral order | Microsoft | 2 |
| #include <stdio.h>
#define a 10
main()
{
#define a 50
printf("%d",a);
} | | 1 |
| main()
{
char a[4]="HELLO";
printf("%s",a);
} | | 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 |
| main( )
{
void *vp;
char ch = ‘g’, *cp = “goofy”;
int j = 20;
vp = &ch;
printf(“%c”, *(char *)vp);
vp = &j;
printf(“%d”,*(int *)vp);
vp = cp;
printf(“%s”,(char *)vp + 3);
} | | 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 |
| func(a,b)
int a,b;
{
return( a= (a==b) );
}
main()
{
int process(),func();
printf("The value of process is %d !\n
",process(func,3,6));
}
process(pf,val1,val2)
int (*pf) ();
int val1,val2;
{
return((*pf) (val1,val2));
} | | 1 |
| Is the following code legal?
typedef struct a
{
int x;
aType *b;
}aType | | 1 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
} | | 1 |
| #include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
} | | 1 |
| How we print the table of 3 using for loop in c
programing? | | 3 |
| main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
} | | 1 |
| What are the files which are automatically opened when a C
file is executed? | | 1 |
| programming in c lanugaue programm will errror error with
two header file one as stdio.h and other one is conio.h | | 1 |
| What is the hidden bug with the following statement?
assert(val++ != 0); | | 1 |
| Derive expression for converting RGB color parameters to
HSV values | | 1 |
| main()
{
signed int bit=512, i=5;
for(;i;i--)
{
printf("%d\n", bit = (bit >> (i - (i -1))));
}
}
a. 512, 256, 128, 64, 32
b. 256, 128, 64, 32, 16
c. 128, 64, 32, 16, 8
d. 64, 32, 16, 8, 4 | HCL | 1 |
| main()
{
char c=' ',x,convert(z);
getc(c);
if((c>='a') && (c<='z'))
x=convert(c);
printf("%c",x);
}
convert(z)
{
return z-32;
} | | 1 |
| How to read a directory in a C program?
| | 4 |
| |
| For more C Code Interview Questions Click Here |