| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| #define swap1(a,b) a=a+b;b=a-b;a=a-b;
main()
{
int x=5,y=10;
swap1(x,y);
printf("%d %d\n",x,y);
swap2(x,y);
printf("%d %d\n",x,y);
}
int swap2(int a,int b)
{
int temp;
temp=a;
b=a;
a=temp;
return;
}
what are the outputs? | Ramco | 4 |
| What is the most efficient way to count the number of bits
which are set in a value? | | 3 |
| 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 |
| what is the output of below pgm?
void main()
{
int i=0;
if(i)
printf("pass");
else
printf("fail");
} | | 3 |
| What is the real difference between arrays and pointers? | | 11 |
| What's the difference between calloc() and malloc()? | | 3 |
| what is the difference between normal variables and pointer
variables.............. | Satyam | 7 |
| proc() {
static i=10;
printf("%d",i);
}
If this proc() is called second time, what is the output?
| Hughes | 5 |
| for example user gives input as " 20 or 20.0 or rs 20.0 or
20.00 or rs20 and so .. on " and the output should be
stored as " rs.20.00 " in a variable | | 2 |
| Go through the following code sinippet
char a[20];
a="Hello Orcale Test";
will this compile?
| Oracle | 3 |
| two progs are given. one starts counting frm 0 to MAX and
the other stars frm MAX to 0. which one executes fast.
| Verifone | 5 |
| what will be the output:
main(){char ch;int a=10;printf("%d",ch);} | Wipro | 29 |
| main()
{
char *ptr = "Ramco Systems";
(*ptr)++;
printf("%s\n",ptr);
ptr++;
printf("%s\n",ptr);
}
Find the Outputs? | CitiGroup | 7 |
| how many times does the loop iterated ?
for (i=0;i=10;i+=2)
printf("Hi\n");
| TCS | 7 |
| How do I declare a pointer to an array? | | 5 |
|
main()
{
int x=10,y=15;
x=x++;
y=++y;
printf("%d %d\n",x,y);
}
output?? | Ramco | 13 |
| Write a C program that computes the value ex by using the
formula
ex =1+x/1!+x2/2!+x3+3!+………….
| | 1 |
| prototype of sine function. | Cadence | 2 |
| actually i have 2 years teaching experience as computer
faculty but now i am a DBA but when i go for interview many
peoples asked me why i left my teaching profession and why
i want to come in this field kindly give me the proper
answer of this queston
| | 1 |
| simple c program for 12345 convert 54321 with out using string | | 5 |
| |
| For more C Interview Questions Click Here |