Cs 116
Cs 116
NOTE: Question No.1 is Compulsory. Attempt ANY FOUR questions from the rest. All questions carry equal
marks. Mobile phones and other electronic gadgets are not allowed. Try to write in neat and legible
writing.
(b) Identify that which of the following statements are TRUE/FALSE. (4)
1. The character data type takes 8 bytes in the memory.
2. &&| is the symbol used for OR operator in C++ language.
3. It is necessary in C++ to declare a variable before its usage in the program.
4. Conditional operator is an alternative to IF-ELSE IF statement.
Q.2 (a) What is meant by operator, discuss the relational and logical operators in C++. (10)
(b) Differentiate between unary operator and binary operator. (4)
Q.4 (a) Describe the IF statement in C++ in detail along with flowchart representation. (8)
(b) Write a program in C++ that input salary, bonus and grade. It adds 50% bonus to the salary if the
grade is greater than 15. It adds 25% bonus to the salary if the grade is 15 or less and then
display the total salary in both cases. (6)
Q.5 (a) Write a program in C++ that takes a number as input from the user and displays
whether it is divisible by 5 or not using IF-ELSE statement. (6)
(b) Write a program in C++ that take an integer "n" as input from the user and calculate
sum using the following formula of the integers from 1 to "n" using WHILE loop. "n"
will be a positive value entered by the user. (8)
(i.e., sum = ((1 + 2 + 3 + ---- + n)/n)
Q.6 (a) What is meant by repetitive control structure, discuss the working of FOR loop in
C++ with flowchart representation. (10)
(b) Write a program in C++ that inputs two numbers form the user and displays the result of the
first number raise to the power of the second number using WHILE loop. (4)
Q.7 (a) What is meant by arrays in C++, explain the usage of one-dimensional array in C++ with the help of a
C++ program. (10)
(b) Differentiate between the local variables and global variables. (4)