Question: Exercise #2: Write a C++ program that declares an array alpha of 50 integer elements. Initialize the array so that the first 25 elements are

 Exercise #2: Write a C++ program that declares an array alpha

Exercise #2: Write a C++ program that declares an array alpha of 50 integer elements. Initialize the array so that the first 25 elements are equal to the square of the index variable and the last 25 elements are equal to three times the index variable. Output the array so that 10 elements per line are printed. Exercise #3: Redo Exercise#2 so that the first 25 elements are randomely generated between and 10 and 50 and the last 25 elements are randomely genrated bewteen -25 and 25. Homework: Modify Exercise#3 to count how many elements are positive and how many are negative. rand() % 100; // will generate random integer between 0-99 rand() % 51-20; // will generate random integer between (0-50)-20 =-20-30

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!