| Other C Code Interview Questions |
| | | Question | Asked @ | Answers | | | | int DIM(int array[])
{
return sizeof(array)/sizeof(int );
}
main()
{
int arr[10];
printf(The dimension of the array is %d, DIM(arr));
} | | 1 | | main()
{
int i = 100;
clrscr();
printf("%d", sizeof(sizeof(i)));
}
a. 2
b. 100
c. 4
d. none of the above | HCL | 2 | | #include<stdio.h>
main()
{
struct xx
{
int x;
struct yy
{
char s;
struct xx *p;
};
struct yy *q;
};
} | | 1 | | main()
{
char string[]="Hello World";
display(string);
}
void display(char *string)
{
printf("%s",string);
} | | 1 | | how to delete an element in an array
| | 1 | | void main()
{
static int i;
while(i<=10)
(i>2)?i++:i--;
printf(%d, i);
} | | 1 | | main()
{
extern out;
printf("%d", out);
}
int out=100; | | 1 | | to remove the repeated cahracter from the given caracter
array.
i.e..,
if the input is SSAD
output should of
SAD | Synergy | 6 | | How to read a directory in a C program?
| | 4 | | What is the hidden bug with the following statement?
assert(val++ != 0); | | 1 | | void main()
{
int *mptr, *cptr;
mptr = (int*)malloc(sizeof(int));
printf(%d,*mptr);
int *cptr = (int*)calloc(sizeof(int),1);
printf(%d,*cptr);
} | | 1 | | main()
{
signed int bit=512, i=5;
for(;i;i--)
{
printf("%d\n", bit >> (i - (i -1)));
}
}
a. 512, 256, 0, 0, 0
b. 256, 256, 0, 0, 0
c. 512, 512, 512, 512, 512
d. 256, 256, 256, 256, 256 | HCL | 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 | | main()
{
int c = 5;
printf("%d", main||c);
}
a. 1
b. 5
c. 0
d. none of the above | HCL | 1 | | #define square(x) x*x
main()
{
int i;
i = 64/square(4);
printf("%d",i);
} | | 1 | | How do you sort a Linked List (singly connected) in O(n)
please mail to pawan.10k@gmail.com if u can find an
anser...i m desperate to knw... | Oracle | 3 | | main()
{
int i=-1;
+i;
printf("i = %d, +i = %d \n",i,+i);
} | | 1 | | main()
{
char *a = "Hello ";
char *b = "World";
clrscr();
printf("%s", strcat(a,b));
}
a. Hello
b. Hello World
c. HelloWorld
d. None of the above | HCL | 1 | | typedef struct error{int warning, error, exception;}error;
main()
{
error g1;
g1.error =1;
printf("%d",g1.error);
} | | 1 | | Is the following code legal?
struct a
{
int x;
struct a b;
} | | 1 | | | | For more C Code Interview Questions Click Here |
|