| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is y value of the code if input x=10
y=5;
if (x==10)
else if(x==9)
elae y=8;
a.9
b.8
c.6
d.7
| TCS | 2 |
| When you call malloc() to allocate memory for a local
pointer, do you have to explicitly free() it? | | 2 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | L&T | 4 |
| Identify the correct argument for the function call fflush
() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above
| Accenture | 3 |
| differentiate between
const char *a;
char *const a; and
char const *a;
| HCL | 1 |
| what is the output of the following program?
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
} | | 7 |
| which will be first in c compiling ,linking or compiling
,debugging. | Sonata | 3 |
| int i;
i=2;
i++;
if(i=4)
{
printf(i=4);
}
else
{
printf(i=3);
}
output of the program ?
| Mascot | 9 |
| regarding the scope of the varibles;identify the incorrect
statement:
a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression
| TCS | 1 |
| What will be the output of
x++ + ++x? | MBT | 13 |
| f(*p)
{
p=(char *)malloc(6);
p="hello";
return;
}
main()
{
char *p="bye";
f(p);
printf("%s",p);
}
what is the o/p?
| Hughes | 4 |
| do ne body have any idea about the salary for the we r going
to have interview.
yup .. u got it right ..i m talking abt NIC. | | 1 |
| Design a program using an array that lists even numbers and
odd numbers separately from the 12 numbers supplied by a user. | | 7 |
| HOW CAN ADD OUR FUNCTION IN LIBRARY. | | 5 |
| why java is called as a purely oops language. | | 2 |
| How can I read a directory in a C program? | Wipro | 1 |
| What is macro? | IBM | 4 |
| what is const volatile? | | 1 |
| what is use of loop? | Infosys | 6 |
| what is calloc and malloc? | | 1 |
| |
| For more C Interview Questions Click Here |