| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How would you write qsort? | | 1 |
| who did come first hen or agg | Infosys | 12 |
| Write a program in c to input a 5 digit number and print it
in words. | | 1 |
| write a own function for strstr | LG-Soft | 1 |
| In scanf h is used for | BFL | 2 |
| how memory store byte
| Huawei | 3 |
| wats the diference btwen constant pointer and pointer to a
constant.pls give examples. | | 6 |
| WRITE A PROGRAM TO FIND A REVERSE OF TWO NO | | 5 |
| Write a program that takes three variables(a,b,c) in as
separate parameters and rotates the values stored so that
value a goes to b,b,to c and c to a | | 3 |
| There are 3 baskets of fruits with worng lables,one basket
has apple,another basket has orange,another has combination
of apple and orange,what is the least way of interchange
the lables. | Google | 10 |
| 2.Given the short c program that follows
a. make a list of the memory variables in this program
b.which lines of code contain operations that change the
contents of memory? what are those operations?
Void main( void)
{
Double base;
Double height;
Double area;
Printf(“enter base and height of triangle :”);
Scanf(“%lg”, &base);
Scanf(“%lg”, &height);
Area=base*height/2.0;
Printf(“the area of the triangle is %g \n”,area);
}
| Wipro | 1 |
| how many header file is in C language ? | | 14 |
| Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
| Oracle | 3 |
| what will be the output:
main(){char ch;int a=10;printf("%d",ch);} | Wipro | 29 |
| Give a method to count the number of ones in a 32 bit number? | | 1 |
| what will be the result of the following program ?
char *gxxx()
{
static char xxx[1024];
return xxx;
}
main()
{
char *g="string";
strcpy(gxxx(),g);
g = gxxx();
strcpy(g,"oldstring");
printf("The string is :
%s",gxxx());
}
a) The string is : string
b) The string is :Oldstring
c) Run time error/Core dump
d) Syntax error during compilation
e) None of these
| IBM | 2 |
| Write a program for the following series?
1
121
12321
1234321
123454321
12345654321
1234567654321
123456787654321
12345678987654321
1234567890987654321
123456789010987654321
12345678901210987654321
1234567890123210987654321
.........1234321............
..........123454321............
..........12345654321............
7
8
9
0
1
Pls............? | | 2 |
| Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
| | 1 |
| Which of the following is not an infinite loop ?
a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}
| TCS | 4 |
| When is an interface "good"?
| | 1 |
| |
| For more C Interview Questions Click Here |