Professional Documents
Culture Documents
BEGIN OUTPUT
A. What will be the output of the following C++ code by using Dry Run and IDE (Dev C++)? [10+10+10+10+10]
B. Draw the exact flow chart of the following C++ code. [10+10+10+10+10]
[Note]: Only error-free code can run successfully.
#include <iostream>
using namespac std;
int main()
{
int divisor, dividend, quotient, remainder;
cout << "Enter dividend :: ";
cin >> dividend;
cout << "\nEnter divisor :: ";
cin >> divisor;
quotient = dividend / divisor;
remainder = dividend % divisor;
cout << "\nQuotient = " << quotient << endl;
cout << "\nRemainder = " << remainder<<endl;
return 0;
}
1. What is the size of the int, float, char, bool, void, double, short, and unsigned data types? [5]
2. How many types of operators are used in C++? Explain with the help of a diagram. [5]
3. What is the resolution operator and in what scenario is it used? [5]
4. What is the difference between C and C++? [5]
5. Difference between declaration and initialization of a variable. Explain with an example. [5]
1. What is the preference for having a global variable and a local variable with the same name in a program and how
do you access the global variable? [5]