| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| prototype of sine function. | Cadence | 2 |
| how to convert binary to decimal and decimal to binary in C
lanaguage | | 4 |
| what is the first address that gets stored in stack
according to a C or C++ compiler???? or what will be the
first address that gets stored when we write a C source
code???????? | Apple | 2 |
| number 2 plssssss help !!....using array.. turbo c..
create a program that will accept a number and determine if
it is a happy number or an unhappy number..
example:
enter a number : 7
7*7=49
then 4 and 9
4*4 and 9*9== 16 + 18 gives you 97
then 9 and 7
9*9 and 7*7 == 81 + 49 gives you 130
then 1 and 3
1*1 and 3*3 == 1 + 9 gives you 10
1*1 gives you 1
sample output:
7= 49= 16+81= 97= 81+49=130 =1+9=10 =1
"7 is a happy number"
. if the last number is 2 then the number being inputed is
not a happy number.
| | 2 |
| fun(int x)
{
if(x > 0)
fun(x/2);
printf("%d", x);
}
above function is called as:
fun(10);
what will it print?
} | NDS | 13 |
| Print all numbers which has a certain digit in a certain
position
eg:
number=45687
1 number=4
2 number=5
etc | | 2 |
| What is the real difference between arrays and pointers? | | 11 |
| write a function for strtok()?? | Verifone | 1 |
| 2.main
{
int x,j,k;
j=k=6;x=2;
x=j*k;
printf("%d", x);
| HCL | 6 |
| what is difference between c and c++ | | 3 |
| 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 |
| wap in c to accept a number display the total count of digit | | 4 |
| struct ptr
{
int a;
char b;
int *p;
}abc;
what is d sizeof structure without using "sizeof" operator?? | Verifone | 8 |
| Can you think of a way when a program crashed before
reaching main? If yes how? | | 2 |
| f(x,y,z)
{
y = y+1;
z = z+x;
}
main()
{
int a,b;
a = 2
b = 2;
f(a+b,a,a);
print a;
}
what is the value of 'a' printed | | 4 |
| dennis ritchie invented C language in AT&T bell laboratory
what is the extension of AT&T? | | 1 |
| Binary tree traversing | Qualcomm | 1 |
| What is the memory allocated by the following definition ?
int (*x)(); | ADITI | 2 |
| consider the following structure:
struct num nam{
int no;
char name[25];
};
struct num nam
n1[]={{12,"Fred"},{15,"Martin"},{8,"Peter"},{11,Nicholas"}};
.....
.....
printf("%d%d",n1[2],no,(*(n1 + 2),no) + 1);
What does the above statement print?
a.8,9
b.9,9
c.8,8
d.8,unpredictable value
| TCS | 3 |
| I have a function which accepts, and is supposed to
initialize,a pointer, but the pointer in the caller remains
unchanged. | | 1 |
| |
| For more C Interview Questions Click Here |