Assignment3

advertisement
‫المملكة العربية السعودية‬
‫وزارة التعليم العالي‬
‫جامعة المجمعة‬
‫كلية علوم الحاسب وتقنية المعلومات‬
Kingdom of Saudi Arabia
Ministry of Higher Education
Majmaah University
Computer Science and Information Technology College
Assignment Due Date Monday April 6
Assignment 3
1) Write a C++ program using if else condition statement to find out whether the number is even or
odd.
Example of the output
Enter the numbers: 3
It is odd
2) Write C++ program that asks the user how many numbers will be entered and after the user enter
those numbers, calculate and print the number of even and odd numbers.
Example of the output
How many numbers? 3
Enter a number: 3
Enter a number: 0
Enter a number: 8
Number of odd numbers
is: 2
Number of even numbers
is: 1
1
Download