| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| why java is platform independent? | Wipro | 10 |
| char *someFun()
{
char *temp = “string constant";
return temp;
}
int main()
{
puts(someFun());
} | | 1 |
| Extend the sutherland-hodgman clipping algorithm to clip
three-dimensional planes against a regular paralleiepiped | IBM | 1 |
| Program to find the largest sum of contiguous integers in
the array. O(n) | | 7 |
| main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
} | | 1 |
| main()
{
int i=10,j=20;
j = i, j?(i,j)?i:j:j;
printf("%d %d",i,j);
} | | 1 |
| main()
{
int i=-1;
-i;
printf("i = %d, -i = %d \n",i,-i);
} | | 1 |
| #include <stdio.h>
main()
{
char * str = "hello";
char * ptr = str;
char least = 127;
while (*ptr++)
least = (*ptr<least ) ?*ptr :least;
printf("%d",least);
} | | 1 |
| Print an integer using only putchar. Try doing it without
using extra storage. | | 1 |
| #define int char
main()
{
int i=65;
printf("sizeof(i)=%d",sizeof(i));
} | | 1 |
| main()
{
41printf("%p",main);
}8 | | 1 |
| void main()
{
static int i=5;
if(--i){
main();
printf("%d ",i);
}
} | | 1 |
| #include<stdio.h>
main()
{
register i=5;
char j[]= "hello";
printf("%s %d",j,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 |
| Given n nodes. Find the number of different structural
binary trees that can be formed using the nodes. | Aricent | 7 |
| main()
{
int i=400,j=300;
printf("%d..%d");
} | | 1 |
| char *someFun1()
{
char temp[ ] = “string";
return temp;
}
char *someFun2()
{
char temp[ ] = {‘s’, ‘t’,’r’,’i’,’n’,’g’};
return temp;
}
int main()
{
puts(someFun1());
puts(someFun2());
} | | 1 |
| main()
{
int i=3;
switch(i)
{
default:printf("zero");
case 1: printf("one");
break;
case 2:printf("two");
break;
case 3: printf("three");
break;
}
} | | 1 |
| main()
{
char *p = “ayqm”;
printf(“%c”,++*(p++));
} | TCS | 2 |
| how to delete an element in an array
| | 1 |
| |
| For more C Code Interview Questions Click Here |