| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| void main()
{
int i=5;
printf("%d",i++ + ++i);
} | ME | 11 |
| void main()
{
int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} };
int (*p)[2];
int i,j,*pint;
for(i=0;i<=3;i++)
{
p=&s[i];
pint=p;
printf("\n");
for(j=0;j<=1;j++)
printf("%d",*(pint+j));
}
} while running this program it shows a warning-suspicious
pointer conversion ie pint=p; my que is why should we assign
the value of p to pint again.why cant we use it directly as
*(p+j)..but if i use like tat the o/p is garbage value.. | | 1 |
| Will Macros support multiple arguments ?
| Oracle | 7 |
| write an algorithm and c program to add two 2x2 matrics | | 1 |
| what are brk, sbrk?
| Oracle | 1 |
| 24.what is a void pointer?
25.why arithmetic operation can’t be performed on a void
pointer?
26.differentiate between const char *a; char *const a;
and char const *a;
27.compare array with pointer?
28.what is a NULL pointer?
29.what does ‘segmentation violation’ mean?
30.what does ‘Bus Error’ mean?
31.Define function pointers?
32.How do you initialize function pointers? Give an example?
33.where can function pointers be used? | | 1 |
| how to create c progarm without void main()? | | 1 |
| write a program to copy a string without using a string? | | 1 |
| 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 | 5 |
| how to implement stack operation using singly linked list | | 1 |
| What is key word in c language? | ABC | 3 |
| What is alloca() and why is its use discouraged? | | 1 |
| how to find the size of the data type like int,float
without using the sizeof operator? | | 8 |
| What is the Difference between Class and Struct? | Motorola | 9 |
| How to add two numbers with using function?
| | 3 |
| what is the difference between declaration ,defenetion and
initialization of a variable? | LG-Soft | 5 |
| How to calculate sum | | 2 |
| how to do in place reversal of a linked list(singly or
doubly)? | | 3 |
| C program to find frequency of each character in a text
file? | | 3 |
| how to use showbits function? | Infosys | 1 |
| |
| For more C Interview Questions Click Here |