C++ Programming - References
Exercise : References - Programs
- References - General Questions
- References - Programs
11.
Which of the following statement is correct about the program given below?
#include<iostream.h>
enum xyz
{
a, b, c
};
int main()
{
int x = a, y = b, z = c;
int &p = x, &q = y, &r = z;
p = ++x;
q = ++y;
r = ++c;
cout<< p << q << r;
return 0;
}
12.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int arr[] = {1, 2 ,3, 4, 5};
int &zarr = arr;
for(int i = 0; i <= 4; i++)
{
arr[i] += arr[i];
}
for(i = 0; i <= 4; i++)
cout<< zarr[i];
return 0;
}
13.
Which of the following statement is correct about the program given below?
#include<iostream.h>
struct Bix
{
short n;
};
int main()
{
Bix b;
Bix& rb = b;
b.n = 5;
cout << b.n << " " << rb.n << " ";
rb.n = 8;
cout << b.n << " " << rb.n;
return 0;
}
14.
What will be the output of the following program?
#include <iostream.h>
enum xyz
{
a, b, c
};
int main()
{
int x = a, y = b, z = c;
int &p = x, &q = y, &r = z;
p = z;
p = ++q;
q = ++p;
z = ++q + p++;
cout<< p << " " << q << " " << z;
return 0;
}
15.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int BixFunction(int m)
{
m *= m;
return((10)*(m /= m));
}
int main()
{
int c = 9, *d = &c, e;
int &z = e;
e = BixFunction(c-- % 3 ? ++*d :(*d *= *d));
z = z + e / 10;
cout<< c << " " << e;
return 0;
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers