Question: write a c++ program by using arrays and loops not use any function. Declare an array by the name of arr and initialize it with

write a c++ program by using arrays and loops not use any function.

Declare an array by the name of ‘arr’ and initialize it with the following values ‘={32.20,41.88,16.12, 23.88, 7.21}’. You can hard code the array just don’t specify the array size as for this problem. Understand and calculate the size of the array in a variable called ‘size’. Traverse the array using any loop and keep storing the elements at the same index after dividing it by two. Display the array being halved. Display the sum of the same array being halved.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here is a simple C program that fulfills your requirements include int main Declare and init... View full answer

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 Programming Questions!