0% found this document useful (0 votes)
17 views2 pages

Final Revision Sheet (Questions)

This document contains 15 questions related to programming basics in C++ including variables, functions, if statements, and loops. The questions cover topics like declaring and assigning variables, writing functions, reading input from the user, checking conditions, iterating through ranges of numbers, and more.

Uploaded by

ifadyezzat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views2 pages

Final Revision Sheet (Questions)

This document contains 15 questions related to programming basics in C++ including variables, functions, if statements, and loops. The questions cover topics like declaring and assigning variables, writing functions, reading input from the user, checking conditions, iterating through ranges of numbers, and more.

Uploaded by

ifadyezzat
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Future University in Egypt

Faculty of Computer Information &


Technology
Fall 2024

Sheet: Final Revision – Questions Only

Basics of Programming with C++


1. Write a program to declare an integer variable, assign it a value, and print the
value.
2. Write a function that takes two integers as parameters and returns their sum.
3. Write a program that reads an integer from the user and prints whether it is even
or odd.
4. Create a program that reads two floating-point numbers from the user and prints
their average.
5. Write a program that declares an array of 5 integers, assigns values to it, and
prints all the values.
If Statements
6. Write a program that reads an integer from the user and prints whether it is
positive, negative, or zero.
7. Write a program that reads three integers from the user and prints the largest
one.
8. Create a program that reads a character from the user and checks if it is a vowel
(a, e, i, o, u) or a consonant.
9. Write a program that checks if a given year is a leap year.
10. Create a program that reads two integers and prints "True" if one of them is 10
or if their sum is 10.
Future University in Egypt
Faculty of Computer Information &
Technology
Fall 2024

Sheet: Final Revision – Questions Only

Loops
11. Write a program that prints all numbers from 1 to 100.
12. Create a program that prints the sum of all even numbers from 1 to 50.
13. Write a program that prints the multiplication table of a given number using a
for loop.
14. Write a program that reads a list of numbers (terminated by -1) and prints their
sum.
15. Create a program that finds the factorial of a given number using a while loop.

You might also like