| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| #include<stdio.h>
main()
{
int a[2][2][2] = { {10,2,3,4}, {5,6,7,8} };
int *p,*q;
p=&a[2][2][2];
*q=***a;
printf("%d----%d",*p,*q);
} | | 1 |
| main(){
int a= 0;int b = 20;char x =1;char y =10;
if(a,b,x,y)
printf("hello");
} | | 1 |
| #define int char
main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
} | | 1 |
| main()
{
char *p="hai friends",*p1;
p1=p;
while(*p!='\0') ++*p++;
printf("%s %s",p,p1);
} | | 1 |
| void main ()
{
int x = 10;
printf ("x = %d, y = %d", x,--x++);
}
a. 10, 10
b. 10, 9
c. 10, 11
d. none of the above | HCL | 1 |
| main()
{
char a[4]="HELL";
printf("%s",a);
} | Wipro | 1 |
| main()
{
41printf("%p",main);
}8 | | 1 |
| main()
{
char *p = "hello world";
p[0] = 'H';
printf("%s", p);
}
a. Runtime error.
b. “Hello world”
c. Compile error
d. “hello world” | HCL | 1 |
| Given n nodes. Find the number of different structural
binary trees that can be formed using the nodes. | Aricent | 7 |
| #define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
} | | 1 |
| main()
{
int i = 3;
for (;i++=0;) printf(“%d”,i);
} | | 1 |
| main()
{
int i = 257;
int *iPtr = &i;
printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) );
} | | 1 |
| How we print the table of 3 using for loop in c
programing? | | 3 |
| What is "far" and "near" pointers in "c"...? | | 3 |
| char *someFun()
{
char *temp = “string constant";
return temp;
}
int main()
{
puts(someFun());
} | | 1 |
| Give a one-line C expression to test whether a number is a
power of 2. | Microsoft | 8 |
| What is the output of the program given below
main()
{
signed char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 |
| print numbers till we want without using loops or condition
statements like specifically(for,do while, while swiches,
if etc)!
| | 7 |
| Is the following code legal?
typedef struct a
{
int x;
aType *b;
}aType | | 1 |
| int i;
main(){
int t;
for ( t=4;scanf("%d",&i)-t;printf("%d\n",i))
printf("%d--",t--);
}
// If the inputs are 0,1,2,3 find the o/p | | 1 |
| |
| For more C Code Interview Questions Click Here |