| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| palindrome for strings and numbers----Can anybody do the
prog? | TCS | 6 |
| 1,1,5,17,61,217,?,?. | | 3 |
| What are the uses of pre-processor directives? | | 2 |
| write a program structure to find average of given number | | 1 |
| 9.how do you write a function that takes a variable number
of arguments? What is the prototype of printf () function?
10.How do you access command-line arguments?
11.what does ‘#include<stdio.h>’ mean?
12.what is the difference between #include<> and #include”…”?
13.what are # pragma staments?
14.what is the most appropriate way to write a
multi-statement macro? | L&T | 4 |
| What is structure padding ? | HP | 2 |
| What's the difference between calloc() and malloc()? | | 3 |
| 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 code for finding depth of tree | Adobe | 1 |
| I use turbo C which allocates 2 bytes for integers and 4
bytes for long. I tried to declare array of size 500000 of
long type using the following code...
long *arr;
arr=(long *)(malloc)(500000 * sizeof(long));
It gives a warning that "Conversion may lose significant
digits in function main"...
And the resulting array size was very less around 8400 as
compared to 500000. Any suggestions will be welcomed....
| | 2 |
| what is output of the following statetment?Printf(“%x”,
-1<<4); ? | | 3 |
| 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 relation between # and include<stdio.h> | HCL | 3 |
| What is an anonymous union and where to apply that ? | HP | 3 |
| write a program to find the sum of the array elements in c
language? | | 8 |
| write a C code To reverse a linked list | Motorola | 2 |
|
#include<stdio.h>
int SumElement(int *,int);
void main(void)
{
int x[10];
int i=10;
for(;i;)
{
i--;
*(x+i)=i;
}
printf("%d",SumElement(x,10));
}
int SumElement(int array[],int size)
{
int i=0;
float sum=0;
for(;i<size;i++)
sum+=array[i];
return sum;
}
output? | Ramco | 5 |
| How can we see the Expanded source code and compiled code
for our source program in C? | | 1 |
| related to rdbms query . | | 1 |
| what is difference between array and structure?
| TCS | 19 |
| |
| For more C Interview Questions Click Here |