C++/ Java Interview Questions - Cisco

1. How much memory will be allocated in the following statement?

int a[5,6]

a) 11 b) 10 c) 9 d) None

2. What is the output of the following statement?

char p[6];
char *d[10];
d=(char*)p

3. What is the output of the following statement?

#define d 10+10
main()
{ cout<
a) 20 b) 10 c) 30 d) None

4. How many levels of node will be present in complete binary tree if the numbers of levels are 4?

5. What is the output of the following statement?

int i,j=1;
for(i=0;i<10;i++);
{
j=j+1;
}
Cout<
a) 10 11 b) 11 10 c) Error d) None

6. Find out the error in the following code?

static char *i;
i=malloc(sizeof(char));
find the error;

a) malloc returns void
b) malloc return integer
c) malloc returns NULL
d) malloc returns a pointer
Post your comment