| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the definition of storage classes? | Wipro | 2 |
| How to access or modify the const variable in c ? | HP | 4 |
| 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 |
| consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
| TCS | 3 |
| Toggle nth bit in a given integer - num | Qualcomm | 2 |
| write a program to arrange the contents of a 1D array in
ascending order | | 3 |
| wt is d full form of c | Wipro | 1 |
| how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");
| TCS | 7 |
| #define min((a),(b)) ((a)<(b))?(a):(b)
main()
{
int i=0,a[20],*ptr;
ptr=a;
while(min(ptr++,&a[9])<&a[8]) i=i+1;
printf("i=%d\n",i);}
| | 3 |
| main()
{int a=200*200/100;
printf("%d",a);
} | TCS | 7 |
| How do I declare an array of N pointers to functions
returning pointers to functions returning pointers
to characters?
| | 1 |
| 4.A function 'q' that accepts a pointer to a character as
argument and returns a pointer to an array of integer can
be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above
| Accenture | 4 |
| Why the use of alloca() is discouraged?
| Oracle | 2 |
| WHAT IS THE DIFFERANCE BITWIN GETS();AND SCANF(); | | 2 |
| macros and function are related in what aspect?
a)recursion b)varying no of arguments
c)hypochecking d)type declaration
| HCL | 8 |
| Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| i=20,k=0;
for(j=1;j<i;j=1+4*(i/j))
{
k+=j<10?4:3;
}
printf("%d", k);
| HCL | 6 |
| what is the output of the following program?
#include<stdio.h>
void main()
{
int x=4,y=3,z;
z=x-- -y;
printf("\n%d %d %d",x,y,z);
} | | 10 |
| How to implement call back functions ? | HP | 2 |
| what does the following code do?
fn(int n,int p,int r)
{
static int a=p;
switch(n){
case 4:a+=a*r;
case 3:a+=a*r;
case 2:a+=a*r;
case 1:a+=a*r;
}
}
a.computes simple interest for one year
b.computes amount on compound interest for 1 to 4 years
c.computes simple interest for four year
d.computes compound interst for 1 year
| TCS | 4 |
| |
| For more C Interview Questions Click Here |