| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| void main()
{
int i=5;
printf("%d",i+++++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 |
| main()
{
extern int i;
i=20;
printf("%d",i);
} | | 1 |
| String reverse with time complexity of n/2 with out using
temporary variable. | NetApp | 8 |
| Extend the sutherland-hodgman clipping algorithm to clip
three-dimensional planes against a regular paralleiepiped | IBM | 1 |
| main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcpy(a,b));
}
a. Hello
b. Hello World
c. HelloWorld
d. None of the above | HCL | 1 |
| Given only putchar (no sprintf, itoa, etc.) write a routine
putlong that prints out an unsigned long in decimal. | | 5 |
| How to swap two variables, without using third variable ? | HCL | 47 |
| typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 |
| main( )
{
char *q;
int j;
for (j=0; j<3; j++) scanf(%s ,(q+j));
for (j=0; j<3; j++) printf(%c ,*(q+j));
for (j=0; j<3; j++) printf(%s ,(q+j));
} | | 1 |
| main()
{
extern i;
printf("%d\n",i);
{
int i=20;
printf("%d\n",i);
}
} | | 1 |
| #define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
} | | 1 |
| Write a function to find the depth of a binary tree. | Adobe | 8 |
| print numbers till we want without using loops or condition
statements like specifically(for,do while, while swiches,
if etc)!
| | 7 |
| #define int char
main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
} | | 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()
{
char a[]="12345\0";
int i=strlen(a);
printf("here in 3 %d\n",++i);
} | | 1 |
| main()
{
int i;
float *pf;
pf = (float *)&i;
*pf = 100.00;
printf("\n %d", i);
}
a. Runtime error.
b. 100
c. Some Integer not 100
d. None of the above | HCL | 1 |
| void main()
{
unsigned giveit=-1;
int gotit;
printf("%u ",++giveit);
printf("%u \n",gotit=--giveit);
} | | 1 |
| main()
{
int x=5;
clrscr();
for(;x<= 0;x--)
{
printf("x=%d ", x--);
}
}
a. 5, 3, 1
b. 5, 2, 1,
c. 5, 3, 1, -1, 3
d. 3, -1, 1, 3, 5 | HCL | 1 |
| |
| For more C Code Interview Questions Click Here |