| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| How to avoid structure padding in C? | Tech-Mahindra | 3 |
| Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
| Mascot | 2 |
| what is the use of using linked list and array? | Infosys | 8 |
| what is the benefit of c30 | | 1 |
| how to add numbers without using arithmetic operators. | | 6 |
| program to find a smallest number in an array | Microsoft | 2 |
| How can I read a directory in a C program? | | 1 |
| program to find middle element of linklist? | Huawei | 1 |
| f(x,y,z)
{
y = y+1;
z = z+x;
}
main()
{
int a,b;
a = 2
b = 2;
f(a+b,a,a);
print a;
}
what is the value of 'a' printed | | 4 |
| what is memory leak?
| | 3 |
| how the size of an integer is decided?
- is it based on processor or compiler or OS? | nvidia | 11 |
| What is true about the following
C Functions
a.Need not return any value
b.Should always return an integer
c.Should always return a float
d.Should always return more than one value.
| TCS | 6 |
| enum day = { jan = 1 ,feb=4, april, may}
what is the value of may?
a)4 b)5 c)6 d)11
e)none of the above
| HCL | 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 |
| how to find the binary of a number? | Infosys | 5 |
| when will be evaluated as true/
if(x==x==x)
a) x=1;
b) x=0;
c) x=-1;
d) none | HCL | 3 |
| We can draw a box in cprogram by using only one printf();&
without using graphic.h header file? | NIIT | 2 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 3 |
| Write a program to print this triangle:
*
**
*
****
*
******
*
********
*
**********
Don't use printf statements;use two nested loops instead.
you will have to use braces around the body of the outer
loop if it contains multiple statements. | | 1 |
| write an interactive program to generate the divisors of a
given integer. | TCS | 2 |
| |
| For more C Interview Questions Click Here |