| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| main()
{
int x=5;
printf("%d %d %d\n",x,x<<2,x>>2);
}
what is the output? | Ramco | 6 |
| How can I call a function, given its name as a string? | ABC-Telecom | 1 |
| int main()
{
int *p=new int;
*p=10;
del p;
cout<<*p;
*p= 60;
cout<<*p;
}
what will be the output & why? | TCS | 3 |
| main()
{
char *p;
p="Hello";
printf("%c\n",*&*p);
}
| ME | 2 |
| what is the difference between <stdio.h> and "stdio.h" | Kanbay | 5 |
| What is an volatile variable? | HP | 6 |
| write a program to find the sum of the array elements in c
language? | | 3 |
| I have a function which accepts a pointer to an int. How
can I pass a constant like 5 to it? | | 3 |
| You are given a string which contains some special
characters. You also have set of special characters. You are
given other string (call it as pattern string). Your job is
to write a program to replace each special characters in
given string by pattern string. You are not allowed to
create new resulting string. You need to allocate some new
memory to given existing string but constraint is you can
only allocate memory one time. Allocate memory exactly what
you need not more not less. | Microsoft | 1 |
| the code is::::: if(condition)
printf("hello");
else
printf("world");
WHAT WILL BE THE CONDITION IN IF IN SUCH A WAY THAT BOTH
HELLO AND WORLD ARE PRINTED IN A SINGLE ATTEMPT?????? SINGLE
ATTEMPT IN THE SENSE... IT MUST FIRST PRINT "HELLO" AND IT
MUST GO TO ELSE PART AND PRINT "WORLD"..... NO LOOPS,
RECURSION ARE ALLOWED........................ | IBM | 7 |
| 10. Study the code:
void show()
main()
{
show();
}
void show (char *s)
{
printf("%sn",s);
}
What will happen if it is compiled & run on an ANSI C
Compiler?
A)It will compile & nothing will be printed when it is
executed
B)it will compile but not link
C)the compiler will generate an error
D)the compiler will generate a warning
| Accenture | 4 |
| Unsigned char c;
for ( c=0;c!=256;c++2)
printf("%d",c);
No. of times the loop is executed ?
| Mascot | 3 |
| What is the diffrent between while and do while statement ? | | 3 |
| If "AaBbCc" is passed to the char
char x(*a)
{
a[0]?x(a+1):1;
printf("%c",a[0]);
return 1;
}
what will be the output?
| Hughes | 5 |
| What is the difference between big endian form and little
endian form? write a code to convert big endian form to
little endian and vice versa.. | Aricent | 1 |
| Write a program that takes three variables(a,b,c) in as
separate parameters and rotates the values stored so that
value a goes to b,b,to c and c to a | | 2 |
| 6. Which of the Following is not defined in string.h?
A)strspn()
B)strerror()
C)memchr()
D)strod()
| Accenture | 1 |
| What is an anonymous union and where to apply that ? | HP | 1 |
| How to write a program for swapping two strings without
using 3rd variable and without using string functions. | iGate | 4 |
| what are brk, sbrk?
| Oracle | 1 |
| |
| For more C Interview Questions Click Here |