01. What is the output of the following program?
void main()
{
int x = 10;
printf ("%d %d", ++x, ++x);
}
02. What is the output of the following program if its command line arguments were . . . sample 1 5 7
main(int argc, char *argv[])
{
int x;
x = argv[1] + argv[2] + argv[3];
printf ("%d", x);
}
03 . What is the output of the following program?
main()
{
struct emp
{
char name[20];
int empno;
};
struct emp e1 = {"harrypotter", 1311};
struct emp e2 = e1;
if (e1==e2)
printf ("e1 and e2 are same");
else
printf ("e1 and e2 are different");
}
04. What is the output of the following program?
void main()
{
int a = -3, b = 2, c= 0, d;
d = ++a && ++b || ++c;
printf ("a = %d, b = %d, c = %d, d = %d", a, b, c, d);
}
05. What is the output of the following program?
main()
{
printf ("Hermione" "Granger");
}
Which statement gets affected when i++ is changed to ++i?
The operator that cannot be overloaded is
Q : What will be the result of this given statement.
for (; ;)
Identify the operator that is NOT used with pointers
Consider the following statements
char *ptr;
ptr = “hello”;
cout << *ptr;
What will be printed?
Given a class named Book, which of the following is not a valid constructor?
Consider the following statements:
int x = 22,y=15;
x = (x>y) ? (x+y) : (x-y);
What will be the value of x after executing these statements?
What is the output of given code fragment?
int f=1, i=2;
while(++i<5)
f*=i;
cout<<f;
What will be the values of x, m and n after the execution of the following statements?
int x, m, n;
m = 10;
n = 15;
x = ++m + n++;
Which of the following will produce a value 10 if x = 9.7?
Consider the following class definitions:
class a
{
};
class b: protected a
{
};
What happens when we try to compile this class?
Which of the following expressions is illegal?
What would be the output of the following program?
int main()
{
int x,y=10,z=10;
x = (y = =z);
cout<<x;
return 0;
}
What will be the output of following program?
#include<iostream.h>
void main()
{
float x;
x=(float)9/2;
cout<<x;
}
What would be the output of the following?
#include<iostream.h>
void main()
{
char *ptr=“abcd”
char ch;
ch = ++*ptr++;
cout<<ch;
}
What will be the result of the expression 13 & 25?
What will be the output of the following program?
#include<iostream.h>
void main()
{
float x=5,y=2;
int result;
result=x % y;
cout<<result;
}
RunTime Polymorphism is achieved by ______
You can read input that consists of multiple lines of text using
Pure virtual functions
Use of virtual functions implies