| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| Which of the following is not an infinite loop ?
a.while(1){
....
}
b.for(;;){
...
}
c.x=0;
do{
/*x unaltered within theloop*/
...
}while(x==0);
d.# define TRUE 0
...
while(TRUE){
....
}
| TCS | 4 |
| what does " calloc" do? | Cadence | 6 |
| True or false: If you continuously increment a variable, it
will become negative?
1) True
2) False
3) It depends on the variable type
| | 4 |
| 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 |
| main()
{
int x=20,y=35;
x = y++ + x++;
y = ++y + ++x;
printf("%d %d\n",x,y);
}
what is the output? | Ramco | 4 |
| f(char *p)
{
p=(char *)malloc(sizeof(6));
strcpy(p,"HELLO");
}
main()
{
char *p="BYE";
f(p)
printf("%s",p);
}
what is the output?
| Hughes | 6 |
| Given an array of length N containing integers between 1
and N, determine if it contains any duplicates. | | 2 |
| 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 |
| What is the output for the program given below
typedef enum grade{GOOD,BAD,WORST,}BAD;
main()
{
BAD g1;
g1=1;
printf("%d",g1);
}
| ADITI | 2 |
| post new interiew question and aptitude test papers | | 1 |
| Can we access RAM?
How? Whats the range of access?
Similarly What are other hardware we can access? | | 1 |
| why we shiuld use main keyword in C | | 4 |
| How can I invoke another program from within a C program? | | 1 |
| How would you find a cycle in a linked list?
| | 2 |
| write a program to search for an element in a given array.
If the array was found then display its position otherwise
display appropriate message in c language | | 1 |
| pick out the odd one out of the following
a.malloc()
b.calloc()
c.free()
d.realloc()
| TCS | 1 |
| what is a headerfile?and what will be a program without it
explain nan example? | Assurgent | 2 |
| How to implement call back functions ? | HP | 1 |
| What's wrong with "char *p = malloc(10);" ? | | 4 |
| 1.find the second maximum in an array?
2.how do you create hash table in c?
3.what is hash collision | Qualcomm | 4 |
| |
| For more C Interview Questions Click Here |