| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| int zap(int n)
{
if(n<=1)then zap=1;
else zap=zap(n-3)+zap(n-1);
}
then the call zap(6) gives the values of zap
[a] 8 [b] 9 [c] 6 [d] 12 [e] 15
| Wipro | 8 |
| What is a far pointer?What is the utility? | | 2 |
| How would you print out the data in a binary tree, level by
level, starting at the top? | Microsoft | 4 |
| write a function to find whether a string is palindrome or
not and how many palindrome this string contain? | | 1 |
| what about "char *(*(*a[])())();"
| Oracle | 2 |
| what is the output of the following program?
main()
{
int i=-1,j=-1,k=0,l=2,m;
m=i++&&j++&&k++||l++;
printf("%d %d %d %d %d",i,j,k,l,m);
} | | 7 |
| WHAT IS THE DIFFERENCE BETWEEN malloc() and calloc() in c
file management?
| | 6 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| Write a program to remove the C comments(/* */) and C++
comments(//) from a file.
The file should be declared in command line. | Subex | 2 |
| What is alloca() and why is its use discouraged? | | 1 |
| How can I set an array's size at run time? | | 7 |
| 2. Counting in Lojban, an artificial language developed
over the last fourty years, is easier than in most languages
The numbers from zero to nine are:
0 no
1 pa
2 re
3 ci
4 vo
5 mk
6 xa
7 ze
8 bi
9 so
Larger numbers are created by gluing the digit togather.
For Examle 123 is pareci
Write a program that reads in a lojban string(representing
a no less than or equal to 1,000,000) and output it in
numbers.
| Nagarro | 2 |
| How to receive strings with spaces in scanf() | | 4 |
| we all know about the function overloading concept used in
C++ and we all learnt abt that.... but that concept is
already came in C in a very smaller propotion ... my
question is IN WHICH CONCEPT THERE IS A USE OF FUNCTION
OVERLOADING IS USED in C language????????????? | Google | 2 |
| which header file contains main() function in c? | TCS | 3 |
| Tell us the difference between these two :
#include"stdio.h"
#include<stdio.h>
define in detial. | | 4 |
| Print all the palindrome numbers.If a number is not
palindrome make it one by attaching the reverse to it.
eg:123
output:123321 (or) 12321 | | 2 |
| How to find the given no is odd or even without checking of
any condition and loops. (Hint: Using array) | | 4 |
| What is the result
main()
{
char c=-64;
int i=-32
unsigned int u =-16;
if(c>i){
printf("pass1,");
if(c<u)
printf("pass2");
else
printf("Fail2");}
else
printf("Fail1);
if(i<u)
printf("pass2");
else
printf("Fail2")
}
a)Pass1,Pass2
b)Pass1,Fail2
c)Fail1,Pass2
d)Fail1,Fail2
e)none
| IBM | 7 |
| array contains zeros and ones as elements.we need to bring
zeros one side and one other side in single parse.
ex:a[]={0,0,1,0,1,1,0,0}
o/p={0,0,0,0,0,1,1,1} | Motorola | 7 |
| |
| For more C Interview Questions Click Here |