| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| who is the founder of c | HP | 9 |
| What is the memory allocated by the following definition ?
int (*x)(); | ADITI | 2 |
| void main()
{int a[5],i,b=16;
for(i=0;i<5;i++)
a[i]=2*i;
f(a,5,b);
for(i=0;i<5;i++)
printf("\n %d",a[i]);
printf("\n %d",b);
}
f(int *x,int n,int y)
{
int i;
for(i=0;i<n;i++)
*(x+i)+=2;
y=y+2;
}wat r the errors in the prg.and improvise the prg to get o/p.? | | 2 |
| What is memmove? | Oracle | 1 |
| what is the output of the following program?
main()
{
int c[]={2,8,3,4,4,6,7,5};
int j,*p=c,*q=c;
for(j=0;j<5;j++)
{
printf("%d",*c);
++q;
}
for(j=0;j<5;j++)
{
printf("%d",*p);
++p;
}
} | | 4 |
| any string of bits of length 'n' represents a unique non-
negative integer between.............? | | 2 |
| a.One Cannot Take the address of a Bit Field
b.bit fields cannot be arrayed
c.Bit-Fields are machine Dependant
d.Bit-fields cannot be declared as static
Which of the Following Statements are true w.r.t Bit-Fields
A)a,b&c B)Only a & b C)Only c D)All
| Accenture | 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 | | 3 |
| What ios diff. Between %e & %f? | Honeywell | 1 |
| 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 |
| 4.weight conversion:
Write a program that will read weight in pounds and convert
it into grams.print both the original weight and the
converted value.There are 454 grams in a pound.design and
carry out a test plan for this program.
| Wipro | 1 |
| Write a program to remove the C comments(/* */) and C++
comments(//) from a file.
The file should be declared in command line. | Subex | 2 |
| difference between semaphores and mutex? | | 1 |
| write a program to generate 1st n fibonacci prime number | | 1 |
| Write a program in c to input a 5 digit number and print it
in words. | | 1 |
| What will be the result of the following program?
main()
{
char p[]="String";
int x=0;
if(p=="String")
{
printf("Pass 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
else
{
printf("Fail 1");
if(p[sizeof(p)-2]=='g')
printf("Pass 2");
else
printf("Fail 2");
}
}
a) Pass 1, Pass 2
b) Fail 1, Fail 2
c) Pass 1, Fail 2
d) Fail 1, Pass 2
e) syntax error during compilation
| IBM | 10 |
| Find Index of least significant bit set in an Integer. ex.
int value is say 10001000 results should be 4. | | 1 |
| how to display 2-D array elements in spiral | | 1 |
| How can I call a function, given its name as a string? | ABC-Telecom | 2 |
| #define MAX(x,y) (x) > (y) ? (x) : (y)
main()
{
int i = 10, j = 5, k = 0;
k = MAX(i++, ++j);
printf("%d %d %d", i,j,k);
}
what will the values of i , j and k?
}
| NDS | 9 |
| |
| For more C Interview Questions Click Here |