| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| What is external and internal variables
What is dynamic memory allocation
what is storage classes in C | | 2 |
| Study the Following Points:
a.One Cannot Take the address of a Bit Field
b.bit fields cannot be arrayed
c.Bit-Fields are machine Dependant
d.Bit-fields cannot be declared as static
1. Which of the Following Statements are true w.r.t Bit-
Fields
A)a,b&c B)Only a & b C)Only c D)All
| Accenture | 1 |
| 1.what are local and global variables?
2.what is the scope of static variables?
3.what is the difference between static and global variables?
4.what are volatile variables?
5.what is the use of 'auto' keyword?
6.how do we make a global variable accessible across files?
Explain the extern keyword?
7.what is a function prototype?
8.what does keyword 'extern' mean in a function declaration?
| | 1 |
| Program to write some contents into a file using file
operations with proper error messages. | | 1 |
| Write the program for displaying the ten most frequent words
in a file such that your program should be efficient in all
complexity measures. | Google | 3 |
| how to find sum of digits in C?
| CTS | 8 |
| How would you print out the data in a binary tree, level by
level, starting at the top? | | 3 |
| What are the different pointer models in c? | | 3 |
| int *p=20;
if u print like dis printf("%d",p);
o\p:- 20; how is it possible?
plz give me the explanation. | Global-Edge | 5 |
| fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
| HCL | 3 |
| how to find out the inorder successor of a node in a tree?? | TCS | 2 |
| main()
{char a[10]={1,2,3,4,5,6};int x;
for(x=0;x<4;x++){ b[x]=x+'a';}
printf("%s",b);}
| | 3 |
| the code is::::: if(condition)
printf("hello");
else
printf("world");
WHAT WILL BE THE CONDITION IN IF IN SUCH A WAY THAT BOTH
HELLO AND WORLD ARE PRINTED IN A SINGLE ATTEMPT?????? SINGLE
ATTEMPT IN THE SENSE... IT MUST FIRST PRINT "HELLO" AND IT
MUST GO TO ELSE PART AND PRINT "WORLD"..... NO LOOPS,
RECURSION ARE ALLOWED........................ | IBM | 7 |
| Write an implementation of “float stringToFloat(char *str).”
The code should be simple, and not require more than the
basic operators (if, for, math operators, etc.).
• Assumptions
• Don’t worry about overflow or underflow
• Stop at the 1st invalid character and return the number
you have converted till then, if the 1st character is
invalid return 0
• Don’t worry about exponential (e.g. 1e10), instead you
should treat ‘e’ as an invalid character
• Write it like real code, e.g. do error checking
• Go though the string only once
• Examples
• “1.23” should return 1.23
• “1a” should return 1
• “a”should return 0
| Qualcomm | 2 |
| How can I call a function, given its name as a string? | ABC-Telecom | 1 |
| which one is not preprocessor directive
a)#if b)#elif c)#undef d)#pragma
| Wipro | 11 |
| what are brk, sbrk?
| Oracle | 1 |
| what is the differnce between AF_INET and PF_INET? | Wipro | 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 |
| write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
| Motorola | 2 |
| |
| For more C Interview Questions Click Here |