Download as pdf or txt
Download as pdf or txt
You are on page 1of 2

C++ Coding SET OF 12 QUESTIONS

{ C++ Syntax & Output: } - This title is only for viewing purposes and can be removed in the real question paper.
1. Write a C++ program that prints the sum of two numbers, 10 and 15.

{ C++ Variables & User Input: } - This title is only for viewing purposes and can be removed in the real question paper.
2. Explain the process of receiving user input for an integer value in C++. Provide an
example code demonstrating this process.

{ C++ Comments & Data Types: } - This title is only for viewing purposes and can be removed in the real question paper.
3. Describe the differences between int, float, and double data types in C++.

{ C++ Operators & Strings: } - This title is only for viewing purposes and can be removed in the real question paper.
4. Using C++, concatenate three strings: "apple," "orange," and "banana," and display
the result.

{ C++ Break/Continue: } - This title is only for viewing purposes and can be removed in the real question paper.
5. Explain the use of break and continue statements in C++.

{ C++ Math & Booleans: } - This title is only for viewing purposes and can be removed in the real question paper.
6. Write a program that checks if a given positive number is a prime number or not. You
are only allowed to use loops (any form), boolean, break/continue and conditional
statements.

{ C++ Conditions & Switch: } - This title is only for viewing purposes and can be removed in the real question paper.
7. Create a program that determines if a year entered by the user is a leap year or not,
using both if-else statements and a switch case.

{ C++ While Loop & For Loop: } - This title is only for viewing purposes and can be removed in the real question paper.
8. Write a C++ program that calculates and displays the factorial of a number entered
by the user using a while loop.

{ C++ User Input & Output: } - This title is only for viewing purposes and can be removed in the real question paper.
9. Build a calculator program that takes two numbers and an operator (+, -, *, /) as input
and displays the result accordingly.

{ C++ Conditions & Operators: } - This title is only for viewing purposes and can be removed in the real question paper.
10. Create a program that checks if a given character is a vowel or consonant using
conditional statements and logical operators.

{ C++ Variables & Math: } - This title is only for viewing purposes and can be removed in the real question paper.
11. Write a program to calculate the area of a circle using a constant value for pi and
user input for radius.
{ Includes most of the topics } - This title is only for viewing purposes and can be removed in the real question paper.
12. Develop a program that allows a user to input their age and calculates their
remaining days until they turn 100 years old. Utilise C++ syntax for user input/output,
variables, conditions, and mathematical operations. Ensure the program handles
non-numeric inputs gracefully and verifies that the entered age is a positive number.

You might also like