1. WHAT IS THE DIFFERENCE BETWEEN C++ AND VC++?

VC++ uses all C++ features. VC++ has GUI and it is user
friendly.It has many programming features
likeWin32, MFC, ATL, ActiveX, DLL's etc.

2. Tell me What is the difference between thread and process?

Thread is a smallest unit of process. In process have one
or more thread.

3. Write a c++ to define a class box with length, breadth and height as data member and input value(), printvalue() and volume() as member functions?

#include<iostream.h>
#include<conio.h>

class BOX
{
private:
int l,b,h;
public:
void input();
void print();
long volume(long,int,int);
};
void BOX::input()
{
cout<<"input values of l,b,&h"<<"n";
cin>>l>>b>>h;
}
void BOX::print()
{
cout<<"volume="<<"n";
}
void BOX::volume()
{
long volume(long l,int b,int h);
{
return(l*b*h);
}
}
void main()
{
set BOX b1;
b1.input();
b1.print();
b1.volume();
return;
}

5. Why & sign is used in copy constructor?

To avoid local copy of object reference (&) is used in copy
constructor.
Moreover if the & is ommited then copy constructor goes in
infinite loop.
eg. if class name is Sample.

Copy constructor without &
Sample :: Sample (Sample s)
{
//Code goes here
}

and we create object as follows. ;
Sample s;
Sample s1(s);

In this scenario program will go in infinite loop.

6. #define CUBE(x) (x*x*x)
main()
{ int a,b=3;
a=cube(b++);
printf("%d %d",a,b);
}
What should be the value of a and b? My calc a=4 but syst
a=6 how pls tell me if you know it?

27 4 is the output.

the call to the macro sets a = b*b*b with b = 3, 3 cubed is 27
then b is incremented to 4 after the macro call

7. Write a c++ program to create an object of a class called employee containing the employee code name designation basic salarry HRA Da gross salary as data 10 such objects "members process "?

#include<iostream.h>
#include<conio.h>
class person
{
int person;
float salery;
}p;
cout<<"enter the person name";
cin>>p.person;
cout<<"enter the salery";
cin>>p.salery;
}
void main()
{
person;
getch();
}

8. Why we are using the fork command and how it works?

In linux fork() system call is used to create a child
process. The Child process inherits some properties of its
parent and operates in a separate memory space

9. How to get the sum of two integers?

#include<stdio.h>
#include<conio.h>
void main()
{
clrscr();
int i,j,sum;
printf("enter two numbers");
scanf("%d%d",&i,&j);
sum=i+j;
printf("sum=%d",sum);
}

10. Tell me about c++?

c++ is object oriented programming language.. the main
function value should return.

Download Interview PDF