| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");
| TCS | 6 |
| void main()
{
char far *farther,*farthest;
printf("%d..%d",sizeof(farther),sizeof(farthest));
}
| ME | 3 |
| write a program to find out number of on bits in a number?
| Huawei | 11 |
| What will be result of the following program?
void myalloc(char *x, int n)
{
x= (char *)malloc(n*sizeof(char));
memset(x,\0,n*sizeof(char));
}
main()
{
char *g="String";
myalloc(g,20);
strcpy(g,"Oldstring");
printf("The string is %s",g);
}
a) The string is : String
b) Run time error/Core dump
c) The string is : Oldstring
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower
integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value | Accenture | 3 |
| 2. What is the function of ceil(X) defined in math.h do?
A)It returns the value rounded down to the next lower
integer
B)it returns the value rounded up to the next higher integer
C)the Next Higher Value
D)the next lower value
| Accenture | 2 |
| write a c program to accept a given integer value and print
its value in words | | 2 |
| helllo sir ,
what is the main use of the pointer ,array ,and the
structure with the example of a programe | | 1 |
| 6)swap(int x,y)
{
int temp;
temp=x;
x=y;
y=temp;
}
main()
{
int x=2;y=3;
swap(x,y);
}
after calling swap ,what are yhe values x&y?
| | 2 |
| if a person is buying coconuts of Rs10,and then sell that
coconuts of Rs9,with the loss of one rupee.After that the
person became a millaniore.how? | Wipro | 5 |
| Convert the following expression to postfix and prefix
(A+B) * (D-C) | | 1 |
| dibakar & vekatesh..uttejana here..abt ur reply for in
place reversal of linked list..wats p stands for there? | | 1 |
| enum colors {BLACK,BLUE,GREEN}
main()
{
printf("%d..%d..%d",BLACK,BLUE,GREEN);
return(1);
}
| ME | 2 |
| write an interactive program to generate the divisors of a
given integer. | TCS | 2 |
| f()
{
int a=2;
f1(a++);
}
f1(int c)
{
printf("%d", c);
}
c=?
| Geometric-Software | 2 |
| 11. Look at the Code:
#include<string.h>
void main()
{
char s1[]="abcd";
char s2[10];
char s3[]="efgh";
int i;
clrscr();
i=strcmp(strcat(s3,ctrcpy(s2,s1))strcat(s3,"abcd"));
printf("%d",i);
}
What will be the output?
A)No output B) A Non Integer C)0 D) Garbage
| Accenture | 5 |
| To what value do nonglobal variables default?
1) auto
2) register
3) static
| | 4 |
| pick out the odd one out of the following
a.malloc()
b.calloc()
c.free()
d.realloc()
| TCS | 1 |
| pgm to find number of words starting with capital letters
in a file(additional memory usage not allowed)(if a word
starting with capital also next letter in word is capital
cann't be counted twice) | Subex | 1 |
| What are advantages and disadvantages of recursive
calling ? | HP | 6 |
| |
| For more C Interview Questions Click Here |