| Other C Interview Questions |
| |
| Question | Asked @ | Answers |
| |
| difference between my-strcpy and strcpy ? | Geometric-Software | 3 |
| What is an object?
| | 2 |
| fn f(x)
{ if(x<=0)
return;
else f(x-1)+x;
}
| HCL | 3 |
| Which is not valid in C?
1) class aClass{public:int x;}
2) /* A comment */
3) char x=12;
| | 4 |
| what is c?
| Tech-Mahindra | 4 |
| read the folllowing code
# define MAX 100
# define MIN 100
....
....
if(x>MAX)
x=1;
else if(x<MIN)
x=-1;
x=50;
if the initial value of x=200,what is the vlaue after
executing this code?
a.200
b.1
c.-1
d.50
| TCS | 2 |
| f=(x>y)?x:y
a) f points to max of x and y
b) f points to min of x and y
c)error
| HCL | 3 |
| what is the difference between const volatile int i
& volatile const int j; | HCL | 1 |
| What should be keep precautions while using the recursion
method? | | 1 |
| In the following code segment what will be the result of the
function,
value of x , value of y
{
unsigned int x=-1;
int y;
y = ~0;
if(x == y)
printf("same");
else
printf("not same");
}
a) same, MAXINT, -1
b) not same, MAXINT, -MAXINT
c) same , MAXUNIT, -1
d) same, MAXUNIT, MAXUNIT
e) not same, MAXINT, MAXUNIT
| IBM | 1 |
| write a C code
to reverse a string using a recursive function, without
swapping or using an extra memory.
| Motorola | 2 |
| What is structure padding ? | HP | 1 |
| What is the difference b/w main() in C language and main()
in C++. | | 3 |
| Why doesn't C have nested functions? | | 1 |
| How to implement variable argument functions ? | HP | 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 |
| identify the in correct expression
a.a=b=3=4;
b.a=b=c=d=0;
float a=int b=3.5;
d.int a;
float b;
a=b=3.5;
| TCS | 4 |
| two progs are given. one starts counting frm 0 to MAX and
the other stars frm MAX to 0. which one executes fast.
| Verifone | 3 |
| Explain what?s happening in the first constructor: public
class c{ public c(string a) : this() {;}; public c() {;} }
How is this construct useful?
| | 1 |
| #define DCHAR char*
typedef char* TCHAR;
if using these following variables will be declared like
DCHAR ch1, ch2;
TCHAR ch3, ch4;
then what will be types of ch1, ch2, ch3 and ch4?
| NDS | 1 |
| |
| For more C Interview Questions Click Here |