| 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 |
| plz send me all data structure related programs | | 1 |
| Given an array of size N in which every number is between 1
and N, determine if there are any duplicates in it. You are
allowed to destroy the array if you like. | Microsoft | 14 |
| int aaa() {printf(“Hi”);}
int bbb(){printf(“hello”);}
iny ccc(){printf(“bye”);}
main()
{
int ( * ptr[3]) ();
ptr[0] = aaa;
ptr[1] = bbb;
ptr[2] =ccc;
ptr[2]();
} | | 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 |
| void main()
{
int const * p=5;
printf("%d",++(*p));
} | | 1 |
| main()
{
int a=10,*j;
void *k;
j=k=&a;
j++;
k++;
printf("\n %u %u ",j,k);
} | | 1 |
| Find your day from your DOB? | Microsoft | 12 |
| main()
{
if ((1||0) && (0||1))
{
printf("OK I am done.");
}
else
{
printf("OK I am gone.");
}
}
a. OK I am done
b. OK I am gone
c. compile error
d. none of the above | HCL | 1 |
| main()
{
int i=10,j=20;
j = i, j?(i,j)?i:j:j;
printf("%d %d",i,j);
} | | 1 |
| main()
{
char a[4]="HELL";
printf("%s",a);
} | Wipro | 1 |
| plz send me all data structure related programs | | 2 |
| main()
{
int c=- -2;
printf("c=%d",c);
} | | 1 |
| main()
{
char *p;
printf("%d %d ",sizeof(*p),sizeof(p));
} | | 1 |
| #include<stdio.h>
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s=malloc(sizeof(struct xx));
printf("%d",s->x);
printf("%s",s->name);
} | | 1 |
| How do you write a program which produces its own source
code as its output?
| | 7 |
| main()
{
extern int i;
i=20;
printf("%d",sizeof(i));
} | | 1 |
| Program to find the largest sum of contiguous integers in
the array. O(n) | | 7 |
| 1)
int i=5;
j=i++ + i++ + i++;
printf("%d",j);This code gives the answer 15.But if we
replace the value of the j then anser is different?why?
2)int i=5;
printf("%d",i++ + i++ + i++);
this givs 18. | Infosys | 6 |
| Write a program that find and print how many odd numbers in
a binary tree | | 1 |
| |
| For more C Code Interview Questions Click Here |