| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What are .h files and what should I put in them? | | 3 |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 5 |
| what is the value of 'i'?
i=strlen("Blue")+strlen("People")/strlen("Red")-strlen("green")
| Cadence | 4 |
| struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator?? | Verifone | 8 |
| print the following using nested for loop.
5 4 3 2 1
1 2 3 4
3 2 1
1 2
1
2 1
1 2 3
4 3 2 1
1 2 3 4 5 | | 5 |
| What is an volatile variable? | HP | 12 |
| what is the use of pointers | | 5 |
| code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3 | | 3 |
| 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 |
| explain about storage of union elements. | Bosch | 2 |
| f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
| HCL | 4 |
| write a program to compare 2 numbers without using logical
operators? | IBM | 1 |
| what's the return value of malloc() | | 8 |
| write a function which accept two numbers from main() and
interchange them using pointers? | | 3 |
| main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
| CitiGroup | 7 |
| How to calculate Total working time using Login and
logout? | Wipro | 2 |
| 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 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 2 |
| #include <stdio.h>
int main ( int argc, char* argv [ ] )
{
int value1 = 10;
int value2 = 5;
printf ( "\n The sum is :%d", value1 | value2 );
}
This is the answer asked by some one to add two numbers
with out using arithmetic operator?Yes this answer is write
it given out put as 15.But how?????
what is need of following line?
int main ( int argc, char* argv [ ] )
how it work?what is the meaning for this line?
please explain me.Advance thanks | Excel | 4 |
| how to sort two array of characters and make a new array of
characters. | Accenture | 1 |
| |
| For more C Interview Questions Click Here |