14.
Given the variables p, q are of char type and r, s, t are of int type. Select the right statement?
 1. t = (r * s) / (r + s);
2. t = (p * q) / (r + s);

15.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int main()
{
    float f1 = 0.5;
    double f2 = 0.5;
    if (f1 == 0.5f)
        cout << "equal";
    else
        cout << "not equal";
    return 0;
}

17.
Pick the right option.
Statement 1: A definition is also a declaration.
Statement 2: An identifier can be declared just once.

18.
What will be the output of the following C++ code?
#include <iostream>
using namespace std;
int g = 100;
int main()
{
    int a;
    {
        int b;
        b = 20;
        a = 35;
        g = 65;
        cout << b << a << g;
    }
    a = 50;
    cout << a << g;
    return 0;
}

Read More Section(Variables and Data Types in C plus plus)

Each Section contains maximum 100 MCQs question on Variables and Data Types in C plus plus. To get more questions visit other sections.