| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
char i=0;
for(;i>=0;i++) ;
printf("%d\n",i);
} | | 1 |
| main()
{
int i = 3;
for (;i++=0;) printf(“%d”,i);
} | | 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 |
| What is the problem with the following code segment?
while ((fgets(receiving array,50,file_ptr)) != EOF)
; | | 1 |
| how can u draw a rectangle in C | Wipro | 31 |
| main()
{
if (!(1&&0))
{
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 |
| How to access command-line arguments? | | 4 |
| void main()
{
static int i=i++, j=j++, k=k++;
printf(“i = %d j = %d k = %d”, i, j, k);
} | | 1 |
| main()
{
int i, j;
scanf("%d %d"+scanf("%d %d", &i, &j));
printf("%d %d", i, j);
}
a. Runtime error.
b. 0, 0
c. Compile error
d. the first two values entered by the user | HCL | 1 |
| main ( )
{
static char *s[ ] = {“black”, “white”, “yellow”,
“violet”};
char **ptr[ ] = {s+3, s+2, s+1, s}, ***p;
p = ptr;
**++p;
printf(“%s”,*--*++p + 3);
} | | 1 |
| void main()
{
int *i = 0x400; // i points to the address 400
*i = 0; // set the value of memory location pointed by i;
} | | 1 |
| main()
{
int i=0;
for(;i++;printf("%d",i)) ;
printf("%d",i);
} | | 1 |
| main()
{
char *p;
int *q;
long *r;
p=q=r=0;
p++;
q++;
r++;
printf("%p...%p...%p",p,q,r);
} | | 1 |
| main()
{
clrscr();
}
clrscr(); | | 1 |
| How can u say that a given point is in a triangle?
1. with the co-ordinates of the 3 vertices specified.
2. with only the co-ordinates of the top vertex given. | | 1 |
| main()
{
int i=5;
printf("%d",++i++);
} | | 1 |
| How to reverse a String without using C functions ? | Wipro | 14 |
| main()
{
unsigned int i=65000;
while(i++!=0);
printf("%d",i);
} | | 1 |
| main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
} | | 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 |
| |
| For more C Code Interview Questions Click Here |