| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| what is the use of #pragma pack, wer it is used? | | 1 |
| how does the C compiler interpret the following two statements
p=p+x;
q=q+y;
a.p=p+x;
q=q+y
b.p=p+xq=q+y
c.p=p+xq;
q=q+y
d.p=p+x/q=q+y
| TCS | 2 |
| Identify the correct argument for the function call fflush
() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above
| Accenture | 2 |
| Write a program to interchange two variables without using
the third variable? | Accenture | 9 |
| compute the nth mumber in the fibonacci sequence? | TCS | 6 |
| how does the for loop work actually..suppose for the
following program how it ll work plz explain to me
for(i=5;i>=0;i--)
prinf(i--); | RMSI | 13 |
| HOW DO YOU HANDLE EXCEPTIONS IN C?
| AppLabs | 2 |
| without a terminator how can we print a message in a printf
() function. | NIIT | 3 |
| main()
{
int a=0;
if(a=0) printf("Ramco Systems\n");
printf("India\n");
}
output? | Ramco | 6 |
| Explain what?s happening in the first constructor: public
class c{ public c(string a) : this() {;}; public c() {;} }
How is this construct useful?
| | 1 |
| Implement a function that returns the 5th element from the
end in a singly linked list of integers in one pass. | Microsoft | 2 |
| write a program to check whether a given integer is a strong
number or not?
[Hint:
145=1!+4!+5!
=1+24+120
=145]
| | 1 |
| What is the Difference between Class and Struct? | Motorola | 9 |
| What are the uses of pre-processor directives? | | 2 |
| 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 |
| 52.write a “Hello World” program in “c” without using a
semicolon?
53.Give a method to count the number of ones in a 32 bit number?
54.write a program that print itself even if the source file
is deleted?
55.Given an unsigned integer, find if the number is power of 2? | | 4 |
| How can I set an array's size at run time? | | 7 |
| Why doesn't C have nested functions? | | 1 |
| n=7623
{
temp=n/10;
result=temp*10+ result;
n=n/10
}
| Wipro | 3 |
| Please list all the unary and binary operators in C. | | 1 |
| |
| For more C Interview Questions Click Here |