- In the following program what is the value of e?
enum number { a= -1, b= 4,c,d,e}
(a) 7 (b) 4 (c) 5 (d) 15 (e) 3
2.What is the output in the following program?
main()
{char c=-64;
int i=-32
unsigned int u =-16;
if(c>i)
{cout<<pass1;
if(c<i)
cout<<pass2;
else
cout<<fail2;
}
else
cout<<fail1;
if(i<c)
cout<<pass2;
else
cout<<fail2;}
a) Pass1,Pass2 b) Pass1,Fail2 c) Fail1,Pass2 d) Fail1,Fail2
e) None of these
- What is the output of the following program is
main()
{int i=0;
for(i=0;i<20;i++)
{switch(i)
case 0:i+=5;
case 1:i+=2;
case 5:i+=5;
default i+=4;
break;}
cout<<i;}}
a) 0,5,9,13,17 b) 5, 9, 13, 17 c) 12, 17, 22 d) 16, 21 e) Syntax error
- Why link list is used?
- What is the difference between a normal pointer and a void pointer?
- What is Hash function? Explain with an example</fail2;}
</pass2;
</c)
</fail1;
</fail2;
</pass2;
</i)
</pass1;
</i;}}
q2) trace the ouput
struct s{
int i,char j}
main()
{
struct s s1;
s.s1=5;
printf(“%d”,s.s1);
}
q3) condition for empty queue
q4) trace the output
main()
{
int i,j;
int p,q;
p=&i; q=&j;
i = 10;
j= 2;
i = i++ + —j;
j = –i* – ++j; printf(“%d%d”,i,j); printf(“%d%d”,p,*q);
}
- How do you differentiate between aggregation and association?
- How do you find out the size of a class?
- How do you implement an itoa function?
- How do you initialize a pointer to a function?
- How do you link a C++ program to C functions?
- How do you return a structure from functions?
- How do you check whether a linked list is circular?
- How do you decide which integer type to use?
- How do you differentiate between a constructor and destructor?
- What are the different types of Storage classes?
- What do you mean by inline function?
- What is a copy constructor?
- What is a namespace?
- What does extern mean in a function declaration?
- How do you write a function that can reverse a linked-list?
- What are the benefits of using exceptions in C++?
- What are the differences between a struct and a class in C++?
- What does extern mean in a function declaration?
- What does it mean to declare a function or variable as static?
- What is a conversion constructor?
Read More