| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Struct(s)
{
int a;
long b;
}
Union (u)
{int a;
long b;
}
Print sizeof(s)and sizeof(u) if sizeof(int)=4 and
sizeof(long)=4
| Mascot | 2 |
| What is the memory allocated by the following definition ?
int (*x)(); | ADITI | 2 |
| what is the use of pointers | | 5 |
| What compilation do? | Geometric-Software | 7 |
| pgm to find number of words starting with capital letters
in a file(additional memory usage not allowed)(if a word
starting with capital also next letter in word is capital
cann't be counted twice) | Subex | 1 |
| pointer_variable=(typecasting
datatype*)malloc(sizeof(datatype));
This is the syntax for malloc?Please explain this,how it
work with an example? | Excel | 2 |
| write a own function to compare two strings with out using
stringcomparition function? | LG-Soft | 3 |
| logic for generating all the combinations of the any number
of given letters.
ex:::::::::
if a,b,c,d are given the o/p should be
abcd,dcba,dbac,bcad,................
4*3*2*1 combinations............ | Infosys | 2 |
| What is external and internal variables
What is dynamic memory allocation
what is storage classes in C | | 2 |
| Explain in detail how strset (string handling function
works )pls explain it with an example. | | 1 |
| 2.Given the short c program that follows
a. make a list of the memory variables in this program
b.which lines of code contain operations that change the
contents of memory? what are those operations?
Void main( void)
{
Double base;
Double height;
Double area;
Printf(enter base and height of triangle :);
Scanf(%lg, &base);
Scanf(%lg, &height);
Area=base*height/2.0;
Printf(the area of the triangle is %g \n,area);
}
| Wipro | 1 |
| I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it? | | 3 |
| How do you write a program which produces its own source
code as its output? | | 2 |
| what are the interview question's in the language c | Nipuna | 1 |
| #define f(x)
main()
{
printf("\n%d",f(2+2));
} | | 3 |
| 2)#include<iostream.h>
main()
{
printf("Hello World");
}
the program prints Hello World without changing main() the
o/p should
be
intialisation
Hello World
Desruct
the changes should be
a)iostream operator<<(iostream os, char*s)
os<<'intialisation'<<(Hello World)<<Destruct
b) c) d)none of the above | Siemens | 4 |
| write a program to print sum of each row of a 2D array.
| | 2 |
| Can we access RAM?
How? Whats the range of access?
Similarly What are other hardware we can access? | | 1 |
| How does free() know how many bytes to free? | | 5 |
| convert 0.9375 to binary | CTS | 1 |
| |
| For more C Interview Questions Click Here |