| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Finding a number multiplication of 8 with out using
arithmetic operator | NetApp | 8 |
| String copy logic in one line. | NetApp | 9 |
| 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 |
| main()
{
int i=10;
i=!i>14;
Printf ("i=%d",i);
} | | 1 |
| main()
{
int i=4,j=7;
j = j || i++ && printf("YOU CAN");
printf("%d %d", i, j);
} | | 1 |
| how to delete an element in an array
| | 1 |
| Declare an array of N pointers to functions returning
pointers to functions returning pointers to characters? | | 1 |
| to remove the repeated cahracter from the given caracter
array.
i.e..,
if the input is SSAD
output should of
SAD | Synergy | 6 |
| void main()
{
int i=i++,j=j++,k=k++;
printf(“%d%d%d”,i,j,k);
} | | 1 |
| main()
{
int a[10];
printf("%d",*a+1-*a+3);
} | | 1 |
| main()
{
char name[10],s[12];
scanf(" \"%[^\"]\"",s);
}
How scanf will execute? | | 1 |
| How will u find whether a linked list has a loop or not? | Microsoft | 6 |
| #define assert(cond) if(!(cond)) \
(fprintf(stderr, "assertion failed: %s, file %s,
line %d \n",#cond,\
__FILE__,__LINE__), abort())
void main()
{
int i = 10;
if(i==0)
assert(i < 100);
else
printf("This statement becomes else for if in
assert macro");
} | | 1 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
} | | 1 |
| main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
} | | 1 |
| main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
} | TCS | 2 |
| void main()
{
int *i = 0x400; // i points to the address 400
*i = 0; // set the value of memory location pointed by i;
} | | 1 |
| Is the following code legal?
struct a
{
int x;
struct a b;
} | | 1 |
| main()
{
{
unsigned int bit=256;
printf("%d", bit);
}
{
unsigned int bit=512;
printf("%d", bit);
}
}
a. 256, 256
b. 512, 512
c. 256, 512
d. Compile error | HCL | 1 |
| main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
} | | 1 |
| |
| For more C Code Interview Questions Click Here |