| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after
executing this code?
a.200
b.1
c.-1
d.50
| TCS | 2 |
| What is Heap? | | 3 |
| Give the output for the following program.
#define STYLE1 char
main()
{
typedef char STYLE2;
STYLE1 x;
STYLE2 y;
clrscr();
x=255;
y=255;
printf("%d %d\n",x,y);
}
| ADITI | 1 |
| write a program to arrange the contents of a 1D array in
ascending order | | 2 |
| There is a 100-story building and you are given two eggs.
The eggs (and the building) have an interesting property
that if you throw the egg from a floor number less than X,
it will not break. And it will always brake if the floor
number is equal or greater than X. Assuming that you can
reuse the eggs which didn't broke; you got to find X in a
minimal number of throws. Give an algorithm to find X in
minimal number of throws. | | 2 |
| What's wrong with "char *p; *p = malloc(10);"? | | 5 |
| plz answer.. a program that takes a string e.g. "345" and
returns integer 345 | | 2 |
| Explain following declaration
int *P(void);
and
int (*p)(char *a);
| | 2 |
| write a program to print sum of each row of a 2D array.
| | 2 |
| 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 |
| What are .h files and what should I put in them? | | 3 |
| what are the various memory handling mechanisms in C ? | HP | 2 |
| consider the following program sigment
int n,sum=1;
switch(n) {
case 2:sum=sum+2;
case 3:sum*=2;
break;
default:sum=0;}
if n=2, what is the value of sum
a.0
b.6
c.3
d.none
| TCS | 3 |
| Explain in detail how strset (string handling function
works )pls explain it with an example. | | 1 |
| what are brk, sbrk?
| Oracle | 1 |
| Write a program to generate prime factors of a given integer? | | 1 |
| #include<stdio.h>
main()
{
char s1[]="Ramco";
char s2[]="Systems";
s1=s2;
printf("%s",s1);
}
Find the output | CitiGroup | 4 |
| What is meant by
int fun const(int a, int b) {
....
...
}
| | 1 |
| program to get the remainder and quotant of given two
numbers with out using % and / operators? | IBM | 4 |
| How to implement call back functions ? | HP | 1 |
| |
| For more C Interview Questions Click Here |