| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| how to find the kth smallest element in the given list of
array elemnts.
| Silicon | 5 |
| main()
{
float a=3.2e40;
printf("%d",a);
} | Satyam | 5 |
| 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 |
| Program to trim a given character from a string. | NetApp | 4 |
| 4.A function 'q' that accepts a pointer to a character as
argument and returns a pointer to an array of integer can
be declared as:
A)int (*q(char*)) []
B)int *q(char*) []
C)int(*q)(char*) []
D)None of the Above
| Accenture | 4 |
| how to generate the length of a string without using len
funtion? | | 3 |
| f1()
{
f(3);}
f(int t)
{
switch(t);
{
case 2: c=3;
case 3: c=4;
case 4: c=5;
case 5: c=6;
default: c=0;}
value of c?
| Geometric-Software | 5 |
| What is structure packing ? | HP | 1 |
| What are advantages and disadvantages of recursive
calling ? | HP | 11 |
| disadvantages of realloc ? | HCL | 1 |
| regarding the scope of the varibles;identify the incorrect
statement:
a.automatic variables are automatically initialised to 0
b.static variables are are automatically initialised to 0
c.the address of a register variable is not accessiable
d.static variables cannot be initialised with any expression
| TCS | 1 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| Reverse the part of the number which is present from
position i to j. Print the new number.[without using the array]
eg:
num=789876
i=2
j=5
778986 | | 2 |
| how to find turn around time in operating system? | | 1 |
| how to estimate the disk access time?
e.g. the time between read one byte and another byte in the
disk. | Google | 3 |
| Which of the following are valid "include" formats?
A)#include and #include[file.h]
B)#include (file.h) and #include
C)#include [file.h] and #include "file.h"
D)#include <file.h> and #include "file.h"
| Accenture | 14 |
| a=0;
while(a<5)
printf("%d\n",a++);
how many times does the loop occurs?
a.infinite
b.5
c.4
d.6
| TCS | 5 |
| Suppose I want to write a function that takes a generic
pointer as an argument and I want to simulate passing it by
reference. Can I give the formal parameter type void **, and
do something like this?
void f(void **);
double *dp;
f((void **)&dp);
| | 1 |
| What's the difference between calloc() and malloc()? | | 3 |
| What is the difference between char a[] = "string"; and
char *p = "string"; ? | Honeywell | 11 |
| |
| For more C Interview Questions Click Here |