CSE MCQs :: C++ - MCQs
- Which operator is having right to left associativity in the following?
- What is this operator called ?: ?
-
What is the output of this program?
#include
using namespace std;
int main()
{
int a;
a = 5 + 3 * 5;
cout << a;
return 0;
}
- What is the use of dynamic_cast operator?
-
What is the output of this program?
#include < iostream >
using namespace std;
int main()
{
int a = 5, b = 6, c, d;
c = a, b;
d = (a, b);
cout << c << 't' << d;
return 0;
}
-
What is the output of this program?
#include < iostream >
using namespace std;
int main()
{
int i, j;
j = 10;
i = (j++, j + 100, 999 + j);
cout << i;
return 0;
}
-
What is the output of this program?#include < iostream >using namespace std;int main (){int x, y;x = 5;y = ++x * ++x;cout << x << y;x = 5;y = x++ * ++x;cout << x << y;return 0;}
-
What is the output of this program?
#include < iostream >
using namespace std;
int main()
{
int a = 5, b = 6, c;
c = (a > b) ? a : b;
cout << c;
return 0;
}
-
What is the output of this program?
#include < iostream >
using namespace std;
main()
{
double a = 21.09399;
float b = 10.20;
int c ,d;
8. c = (int) a;
d = (int) b;
cout << c <<'t'<< d;
return 0;
}