C++ Programming - References
Exercise : References - Programs
- References - General Questions
- References - Programs
6.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int x = 10, y = 20;
int *ptr = &x;
int &ref = y;
*ptr++;
ref++;
cout<< x << " " << y;
return 0;
}
7.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int x = 0;
int &y = x; y = 5;
while(x <= 5)
{
cout<< y++ << " ";
x++;
}
cout<< x;
return 0;
}
8.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int m = 2, n = 6;
int &x = m;
int &y = n;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n;
return 0;
}
9.
Which of the following statement is correct about the program given below?
#include<iostream.h>
int main()
{
int m = 2, n = 6;
int &x = m++;
int &y = n++;
m = x++;
x = m++;
n = y++;
y = n++;
cout<< m << " " << n;
return 0;
}
10.
What will be the output of the following program?
#include<iostream.h>
class BixTest
{
public:
BixTest(int &x, int &y)
{
x++;
y++;
}
};
int main()
{
int a = 10, b = 20;
BixTest objBT(a, b);
cout<< a << " " << b;
return 0;
}
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers