Honey Well Question Paper:
1
void main()
{
int i=32;
char *ptr = (char *) &i;
printf( "%d" , *ptr);
}
2
#define X 5+2
void main()
{
int i;
i = X * X * X;
printf( "%d" , i );
}
3
void main()
{
char c = 125;
c = c + 10;
printf( "%d" , c );
}
4
void main()
{
int i = 4, x;
x = ++i + ++i + ++i;
printf( "%d" , x );
}
5
void main()
{
register int i,x;
scanf( "%d" , &i );
x = ++i + ++i + ++i;
printf( "%d" , x);
}
6
void main()
{
int a = 5;
int b = 10;
{
int a = 2;
a++;
b++;
}
printf( "%d %d" , a , b );
}
7
enum color { red, green = -20, blue ,yellow };
void main()
{
enum color x;
x = yellow;
printf( "%d" , x );
}
8
void main()
{
char c = '0';
printf( "%d %d" , sizeof(c) , sizeof('0') );
}
9
void main()
{
int i =3;
if ( 3==i )
{
printf( "%d" , i << 2 << 1);
}
else
{
printf( " NOT EQUAL" );
}
}
10
void main()
{
const int i = 5;
i++;
printf( "%d" , i );
}
11
void main()
{
const int x = 25;
int *const p = 2x;
*p = 2 * x;
printf( "%d" , x );
}
12
void main()
{
int i = 5 , j = 2;
if ( ++i > j++ i++ > j++ );
printf( "%d" , i + j);
}
13
#define MAX 5
void main()
{
int i = 0;
i = MAX++;
printf( "%d" , i++);
}
14
void main()
{
int a = 5, b = 10, c = 15;
int *array[] = { &a , &b , &c };
printf( "%d" , *array[] );
}
15
void main()
{
int array[1] = {5};
int i ;
for ( i = 0 ; i <= 2 ; i++ )
{
printf( "%d" , array[i] );
}
}
16.LATE BINDING the function calls get resolve during?
-Compilation
-Run time
-Both A & B
-None of Above
17.Inheritance in C++ have default access specifier as?
-PRIVATE
-PUBLIC
-PROTECT
-None of above
18.Convert C++ file to object module is done by?
-Compiler
-Linker
-Both A & B
-none of above
19.Members of the class are by default?
-PRIVATE
-PUBLIC
-PROTECT
-None of above
20.Reference to its own class can be accepted by?
-Simple constructor
-Copy constructor
-Both A & B
-None of the above
21.STRICT parameter type checking is followed with which of the following?
-Inline
-Macros
-Both A & B
-None of Above
22.Friend function of a class in C++ can access as?
-Private member of the class
-Protect member of the class
-Both A & B
-None of above
23.Which is exist in C++
-Virtual destructor
-Virtual constructor
-Both A & B
-None of above
24.(Not sure what exactly the QUS)
Static in C++
-Class
-Object
-Both A & B
-None of above
25.What is the value of EOF(End of file)?
- 1
- 0
- Infinity
- -1
No comments:
Post a Comment