Exercise: References
Questions for: References
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;
}
A:
It will result in a compile time error.
B:
The program will print the output 64 9.
C:
The program will print the output 64 10.
D:
The program will print the output 64 11.
Answer: D
No answer description is available. Let's discuss.
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;
}
A:
2 3 6
B:
4 4 7
C:
4 5 8
D:
3 4 6
Answer: B
No answer description is available. Let's discuss.
Discuss About this Question.
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;
}
A:
It will result in a compile time error.
B:
The program will print the output 5 5 5 8.
C:
The program will print the output 5 5 8 8.
D:
The program will print the output 5 5 5 5.
Answer: C
No answer description is available. Let's discuss.
Discuss About this Question.
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;
}
A:
The program will print the output 1 2 3 4 5.
B:
The program will print the output 2 4 6 8 10.
C:
The program will print the output 1 1 1 1 1.
D:
It will result in a compile time error.
Answer: D
No answer description is available. Let's discuss.
Discuss About this Question.
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;
}
A:
The program will print the output 1 2 3.
B:
The program will print the output 2 3 4.
C:
The program will print the output 0 1 2.
D:
It will result in a compile time error.
Answer: D
No answer description is available. Let's discuss.
Discuss About this Question.
Ad Slot (Above Pagination)
Discuss About this Question.