| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| int a=1,b=2,c=3;
printf("%d,%d",a,b,c);
What is the output?
| Verifone | 14 |
| difference between my-strcpy and strcpy ? | Geometric-Software | 3 |
| In the following control structure which is faster?
1.Switch
2.If-else
and which consumes more memory? | | 4 |
| How to Clear last bit if it 1 using Macro TURN_OFF_BIT_LAST | Adobe | 2 |
| What is the value of y in the following code?
x=7;y=0;
if(x=6)
y=7;
else
y=1;
| TCS | 10 |
| how do u find out the number of 1's in the binary
representation of a decimal number without converting it
into binary(i mean without dividing by 2 and finding out
the remainder)? three lines of c code s there it
seems...can anyone help | | 2 |
| what is difference b/w extern & volatile variable?? | Teleca | 2 |
| While(1)
{
}
when this loop get terminate is it a infinite loop? | | 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 |
| which of the following go out of the loopo if expn 2
becoming false
a.while(expn 1){...if(expn 2)continue;}
b.while(!expn 1){if(expn 2)continue;...}
c.do{..if(expn 1)continue;..}while(expn 2);
d.while(!expn 2){if(expn 1)continue;..}
| TCS | 2 |
| will the program compile? int i; scanf(“%d”,i); printf(“%d”,i); | | 2 |
| 6. Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| void main()
{
int s[4][2]={ {1234,56},{1212,33},{1434,80},{1312,78} };
int (*p)[2];
int i,j,*pint;
for(i=0;i<=3;i++)
{
p=&s[i];
pint=p;
printf("\n");
for(j=0;j<=1;j++)
printf("%d",*(pint+j));
}
} while running this program it shows a warning-suspicious
pointer conversion ie pint=p; my que is why should we assign
the value of p to pint again.why cant we use it directly as
*(p+j)..but if i use like tat the o/p is garbage value.. | | 1 |
| What should be keep precautions while using the recursion
method? | | 1 |
| How many ways are there to swap two numbers without using
temporary variable? Give the each logic. | | 6 |
| What is the real difference between arrays and pointers? | | 11 |
| what is the diference between pointer to the function and
function to the pointer? | | 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 |
| main()
{
printf("hello%d",print("QUARK test?"));
}
| | 4 |
| plz answer....A program that takes 3 variables e.g a,b,c in
as seperate parameters and rotates the values stored so
that value goes a to b, b to c and c to a . | | 3 |
| |
| For more C Interview Questions Click Here |