C++/ Java Interview Questions - Alcatel Lucent

1. What is the output of following function?

type def enum grade{good,bad,worst,}bad;
main()
{
bad a;
a=1;
cout<}

a) 1 b) Garbage value c) good, bad, worst d) Error e) No output

2. What is the output of the following function?

#define style char
main()
{
typedef char style2;
style x;
style2 y;
clrscr();
x=255;
y=255;
cout<}

a) 255, 255 b) ASCII value c) Error d) No output

3. What is the output of the following function?

#ifdef TRUE
int I=0;
#endif
main()
{
int j=0;
cout<}

a) 0 0 b) 2 0 c) 0 2 d) Error e) No output

4. What is the output of the following function?

#include
main()
{
char *pDestn,*pSource="I Love You Daddy";
pDestn=malloc(strlen(pSource));
strcpy(pDestn,pSource);
cout<free(pDestn);
}

(a) Can’t be defined
(b) None
(c) I love You Daddy
(d)Error

5. Write a program to insert a node in a doubly linked list?
6. What is a data structure?
Post your comment