| Other C Code Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
char a[4]="HELL";
printf("%s",a);
} | Wipro | 1 |
| Find your day from your DOB? | Microsoft | 12 |
| main()
{
int i = 100;
clrscr();
printf("%d", sizeof(sizeof(i)));
}
a. 2
b. 100
c. 4
d. none of the above | HCL | 2 |
| int i,j;
for(i=0;i<=10;i++)
{
j+=5;
assert(i<5);
} | | 1 |
| Print an integer using only putchar. Try doing it without
using extra storage. | | 1 |
| Write out a function that prints out all the permutations of
a string.
For example, abc would give you abc, acb, bac, bca, cab,
cba. You can assume that all the characters will be unique. | Microsoft | 4 |
| 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 |
| Give a one-line C expression to test whether a number is a
power of 2. | Microsoft | 8 |
| program to find magic aquare using array | HCL | 3 |
| void main()
{
int i=5;
printf("%d",i+++++i);
} | | 1 |
| main()
{
int i=300;
char *ptr = &i;
*++ptr=2;
printf("%d",i);
} | | 1 |
| Is this code legal?
int *ptr;
ptr = (int *) 0x400; | | 1 |
| main()
{
int i=5;
printf("%d%d%d%d%d%d",i++,i--,++i,--i,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 |
| Write a prog to accept a given string in any order and flash
error if any of the character is different.
For example : If abc is the input then abc, bca, cba, cab
bac are acceptable, but aac or bcd are unacceptable. | Microsoft | 5 |
| main(){
unsigned int i;
for(i=1;i>-2;i--)
printf("c aptitude");
} | | 1 |
| What is the problem with the following code segment?
while ((fgets(receiving array,50,file_ptr)) != EOF)
; | | 1 |
| What is the output for the following program
main()
{
int arr2D[3][3];
printf("%d\n", ((arr2D==* arr2D)&&(* arr2D ==
arr2D[0])) );
} | | 1 |
| program to Reverse a linked list | Ness-Technologies | 4 |
| main()
{
int i=0;
while(+(+i--)!=0)
i-=i++;
printf("%d",i);
} | | 1 |
| |
| For more C Code Interview Questions Click Here |