| Other C Code Interview Questions |
| | | Question | Asked @ | Answers | | | | main()
{
int i;
clrscr();
for(i=0;i<5;i++)
{
printf("%d\n", 1L << i);
}
}
a. 5, 4, 3, 2, 1
b. 0, 1, 2, 3, 4
c. 0, 1, 2, 4, 8
d. 1, 2, 4, 8, 16 | HCL | 1 | | #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()
{
char name[10],s[12];
scanf(" \"%[^\"]\"",s);
}
How scanf will execute? | | 1 | | union u
{
struct st
{
int i : 4;
int j : 4;
int k : 4;
int l;
}st;
int i;
}u;
main()
{
u.i = 100;
printf("%d, %d, %d",u.i, u.st.i, u.st.l);
}
a. 4, 4, 0
b. 0, 0, 0
c. 100, 4, 0
d. 40, 4, 0 | HCL | 1 | | void main()
{
int i;
char a[]="\0";
if(printf("%s\n",a))
printf("Ok here \n");
else
printf("Forget it\n");
} | | 1 | | You are given any character string. Find the number of sets
of vowels that come in the order of aeiou in the given
string. For eg., let the given string be DIPLOMATIC. The
answer returned must be "The number of sets is 2" and "The
sets are "IO and AI". Vowels that form a singleton set must
be neglected. Try to post the program executable in gcc or
g++ or in java. | | 3 | | main()
{
int *j;
{
int i=10;
j=&i;
}
printf("%d",*j);
} | | 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 | | void main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
} | | 1 | | main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
} | | 1 | | main()
{
register int a=2;
printf("Address of a = %d",&a);
printf("Value of a = %d",a);
} | | 1 | | Program to Delete an element from a doubly linked list.
| Infosys | 4 | | void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
} | | 1 | | void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} | | 1 | | main()
{
41printf("%p",main);
}8 | | 1 | | main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
} | | 1 | | What are the files which are automatically opened when a C
file is executed? | | 1 | | Extend the sutherland-hodgman clipping algorithm to clip
three-dimensional planes against a regular paralleiepiped | IBM | 1 | | main()
{
char *str1="abcd";
char str2[]="abcd";
printf("%d %d %d",sizeof(str1),sizeof(str2),sizeof("abcd"));
} | | 1 | | main()
{
int i;
i = abc();
printf("%d",i);
}
abc()
{
_AX = 1000;
} | | 1 | | | | For more C Code Interview Questions Click Here |
|