In: Computer Science
Design the logic for a program that has two parts:
You must use an array and one or more loops to get full credit.
Can someone please help me figure this out?
Hello student. I am using c++ for coding.If you need any other language,
Please comment.Looking forward to help you
code
--------
#include <iostream>
using namespace std;
int main() {
//declaring an array to store 15 numbers
int arr[15];
cout<<"Enter the numbers to be stored in the array : ";
// for loop to read the array values
for(int i=0;i<15;i++)
{
cin>>arr[i];
}
//Print the numbers in the reverse order.
cout<<"\n The numbers in the reverse order :";
for(int i=14;i>=0;i--)
{
cout<<arr[i]<<" ";
}
return 0;
}