| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Identify the correct argument for the function call fflush
() in ANSI C:
A)stdout
B)stdin
C)stderr
D)All the above
| Accenture | 3 |
| What is the Difference between Macro and ordinary
definition? | Motorola | 2 |
| 44.what is the difference between strcpy() and memcpy()
function?
45.what is output of the following statetment?
46.Printf(“%x”, -1<<4); ?
47.will the program compile?
int i;
scanf(“%d”,i);
printf(“%d”,i);
48.write a string copy function routine?
49.swap two integer variables without using a third
temporary variable?
50.how do you redirect stdout value from a program to a file?
51.write a program that finds the factorial of a number
using recursion? | | 3 |
| wats SIZE_T meant for? | | 1 |
| what is a headerfile?and what will be a program without it
explain nan example? | Assurgent | 3 |
| to find the program of matrix multiplication using arrays | | 2 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}
| ME | 2 |
| code snippet for creating a pyramids triangle
ex
1
2 2
3 3 3 | | 2 |
| 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 |
| Given an array of numbers, except for one number all the
others occur twice. Give an algorithm to find that number
which occurs only once in the array. | | 1 |
| what is compiler | | 5 |
| What is the main differences between C and Embedded C? | | 1 |
| How can I implement opaque (abstract) data types in C?
What's the difference between these two declarations?
struct x1 { ... };
typedef struct { ... } x2;
| | 2 |
| main()
{
float a=8.8;
double b=8.8;
if(a==b)
printf("Equal");
else
printf("not equal");
getch();
}
what is the output?
with reason | | 1 |
| program to find middle element of linklist? | Huawei | 1 |
| parkside's triangle..
create a program like this..
enter the size: 6
enter the seed: 1
output:
1
23
456
7891
23456
789123
sample2:
enter the size: 5
enter the seed: 3
output:
3
45
678
9123
45678
parkside should not exceed 10 while its seed should only be
not more than 9.. | | 3 |
| what is the maximum no. of bytes calloc can allocate | Mphasis | 2 |
| two variables are added answer is stored on not for third
variable how it is possible? | | 2 |
| What is the memory allocated by the following definition ?
int (*x)[10];
| ADITI | 3 |
| 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 |
| |
| For more C Interview Questions Click Here |