| Other C Code Interview Questions |
| | | Question | Asked @ | Answers | | | | main(){
unsigned int i;
for(i=1;i>-2;i--)
printf("c aptitude");
} | | 1 | | main()
{
int i=10,j=20;
j = i, j?(i,j)?i:j:j;
printf("%d %d",i,j);
} | | 1 | | Find your day from your DOB? | Microsoft | 12 | | how to delete an element in an array
| | 1 | | main(int argc, char *argv[])
{
(main && argc) ? main(argc-1, NULL) : return 0;
}
a. Runtime error.
b. Compile error. Illegal syntax
c. Gets into Infinite loop
d. None of the above | HCL | 1 | | char *someFun()
{
char *temp = string constant";
return temp;
}
int main()
{
puts(someFun());
} | | 1 | | #define DIM( array, type) sizeof(array)/sizeof(type)
main()
{
int arr[10];
printf(The dimension of the array is %d, DIM(arr,
int));
} | | 1 | | void main()
{
int i=10, j=2;
int *ip= &i, *jp = &j;
int k = *ip/*jp;
printf(%d,k);
} | | 1 | | why java is platform independent? | Wipro | 10 | | Given a list of numbers ( fixed list) Now given any other
list, how can you efficiently find out if there is any
element in the second list that is an element of the
first list (fixed list) | Disney | 3 | | struct Foo
{
char *pName;
};
main()
{
struct Foo *obj = malloc(sizeof(struct Foo));
clrscr();
strcpy(obj->pName,"Your Name");
printf("%s", obj->pName);
}
a. Your Name
b. compile error
c. Name
d. Runtime error | HCL | 1 | | #define SQR(x) x * x
main()
{
printf("%d", 225/SQR(15));
}
a. 1
b. 225
c. 15
d. none of the above | HCL | 1 | | main()
{
int i=1;
while (i<=5)
{
printf("%d",i);
if (i>2)
goto here;
i++;
}
}
fun()
{
here:
printf("PP");
} | | 1 | | main()
{
int i = 3;
for (;i++=0;) printf(%d,i);
} | | 1 | | void pascal f(int i,int j,int k)
{
printf(%d %d %d,i, j, k);
}
void cdecl f(int i,int j,int k)
{
printf(%d %d %d,i, j, k);
}
main()
{
int i=10;
f(i++,i++,i++);
printf(" %d\n",i);
i=10;
f(i++,i++,i++);
printf(" %d",i);
} | | 1 | | main( )
{
static int a[ ] = {0,1,2,3,4};
int *p[ ] = {a,a+1,a+2,a+3,a+4};
int **ptr = p;
ptr++;
printf(\n %d %d %d, ptr-p, *ptr-a, **ptr);
*ptr++;
printf(\n %d %d %d, ptr-p, *ptr-a, **ptr);
*++ptr;
printf(\n %d %d %d, ptr-p, *ptr-a, **ptr);
++*ptr;
printf(\n %d %d %d, ptr-p, *ptr-a, **ptr);
} | | 1 | | 1. const char *a;
2. char* const a;
3. char const *a;
-Differentiate the above declarations. | | 1 | | typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 | | main()
{
int i =10, j = 20;
clrscr();
printf("%d, %d, ", j-- , --i);
printf("%d, %d ", j++ , ++i);
}
a. 20, 10, 20, 10
b. 20, 9, 20, 10
c. 20, 9, 19, 10
d. 19, 9, 20, 10 | HCL | 1 | | How to reverse a String without using C functions ? | Wipro | 13 | | | | For more C Code Interview Questions Click Here |
|