CPE150L Task05 PDF

You might also like

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

Yarmouk University

Faculty of Hijjawi
Computer Engineering Department
CPE 150: Introduction to Programming Laboratory
Task 05
Loops II

1- Write a program for Printing Factors of a positive number. We want to read


a non‐negative integer n and print its factors.
• Examples:
If n= 20 => Factors: 1 2 4 5 10 20

2- Write a program to read N integers, and count number of even, if the counter
of the even numbers reaches to 8, the counting loop should be terminated

3- Write a menu driven C++ program that displays the following menu to the
user:
Main Menu
---------------
1. Factors of Number
2. Count Even Numbers
3. Exit
Please enter your choice:
The program then accepts an input choice from the user. The program acts
based on the input choice as follows:
Choices 1 or 2: The program should execute the above two described
programs respectively.
Choice 3: The program should terminate.
The menu should appear continuously (as infinite loop) to the user until
choosing choice.

Summer 2020

You might also like