| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Can we include one C program into another C program if yes how? | Infosys | 4 |
| What is external and internal variables
What is dynamic memory allocation
what is storage classes in C | | 2 |
| #define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
what are the outputs? | Ramco | 4 |
| 15.what is the disadvantage of using macros?
16.what is the self-referential structure?
17.can a union be self-referenced?
18.What is a pointer?
19.What is the Lvalue and Rvalue?
20.what is the difference between these initializations?
21.Char a[]=”string”;
22.Char *p=”literal”;
23.Does *p++ increment p, or what it points to? | | 1 |
| int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
| Wipro | 8 |
| why we shiuld use main keyword in C | | 5 |
| how to convert binary to decimal and decimal to binary in C
lanaguage | | 4 |
| Write a C function to search a number in the given list of
numbers. donot use printf and scanf | Honeywell | 6 |
| Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
| | 1 |
| 12. Look at the Code:
main()
{
int a[]={1,2,3},i;
for(i=0;i<3;i++)
{
printf("%d",*a);
a++;
}
}
Which Statement is/are True w.r.t the above code?
I.Executes Successfully & Prints the contents of the array
II.Gives the Error:Lvalue Required
III.The address of the array should not be changed
IV.None of the Above.
A)Only I B)Only II C)II & III D)IV
| Accenture | 4 |
| difference between i++* and *++i | IBM | 3 |
| How the C program can be compiled? | HP | 7 |
| what is the difference between declaration and definition
of a variable or function ? | | 2 |
| Identify the correct argument for the function call fflush
() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above
| Accenture | 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. | | 2 |
| can we print any string in c language without using
semicolon(;)(terminator) in whole program. | | 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 |
| What does extern mean in a function declaration? | | 2 |
| Why is conio.h not required when we save a file as .c and
use clrscr() or getch() ? | | 2 |
| dibakar & vekatesh..uttejana here..abt ur reply for in
place reversal of linked list..wats p stands for there? | | 1 |
| |
| For more C Interview Questions Click Here |