11-22-2017, 09:09 PM
CS201 – Introduction to Programming
Assignment No. 2 Solution
Semester: Fall 2017
Assignment
Write a program that will generate random numbers and that numbers will be stored in a two-dimensional array. Then display the generated values on the screen and then also print the even numbers from the generated array elements.
Task 1:
Task 2:
Task 3:
The final task is to find the even numbers in this array and display it on the console. For this purpose create a function findEvenNumber().
Solution: Download attached file for complete CS201 c++ Assignment 2 Solution.
Assignment No. 2 Solution
Semester: Fall 2017
Assignment
Write a program that will generate random numbers and that numbers will be stored in a two-dimensional array. Then display the generated values on the screen and then also print the even numbers from the generated array elements.
Task 1:
First of all, you are required to generate random numbers from 1 to 500. For this, you are required to create a function named as “generateArray. The generateArray will load two- dimensional array with random numbers from 1to 500. The size of the two-dimensional array will be 7*7.
Task 2:
Defined a function named as “showArray(), which will display the elements of the two- dimensional array on the screen. See the sample output.
Task 3:
The final task is to find the even numbers in this array and display it on the console. For this purpose create a function findEvenNumber().
Solution: Download attached file for complete CS201 c++ Assignment 2 Solution.