Question

In C++ Write a program that allows the user to enter eight integer values. Display the...

In C++

Write a program that allows the user to enter eight integer values. Display the values in the reverse order of the order they were entered. Name the file ReverseNumbers.cpp.

0 0
Add a comment Improve this question Transcribed image text
Answer #1
#include <iostream>
using namespace std;

int main() {
   int arr[8];
   
   cout<<"Enter 8 numbers"<<endl;
   for(int i = 0;i<8;i++){
      cin>>arr[i];
   }
   
   cout<<"\nNumbers in reverse order:"<<endl;
   for(int i = 8;i>=0;i--){
      cout<<arr[i]<<endl;
   }
   
   return 0;
}

Add a comment
Know the answer?
Add Answer to:
In C++ Write a program that allows the user to enter eight integer values. Display the...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • In C++ 1. Write a program that allows a user to enter 10 integer values from...

    In C++ 1. Write a program that allows a user to enter 10 integer values from the keyboard. The values should be stored in an array. 2. The program should then ask the user for a number to search for in the array: The program should use a binary search to determine if the number exists in a list of values that are stored in an array (from Step #1). If the user enters a number that is in the...

  • write a python program that allows the user to enter two integer values, and displays the...

    write a python program that allows the user to enter two integer values, and displays the results when each of the following arithmetic operators are applied

  • 2. Write a C++ program that asks the user to enter a integer between 1 and...

    2. Write a C++ program that asks the user to enter a integer between 1 and 10. Continue to prompt the user while the value entered does not fall within the range. When the user is successful display a congratulatory message. Save file as OneToTen.

  • Summary: Write a C program that prompts the user to enter 2 positive integer numbers, display...

    Summary: Write a C program that prompts the user to enter 2 positive integer numbers, display the numbers in 3 formats. Then check, whether the larger of the 2 is evenly divisible by the smaller. Detail: Write a complete C program, more complex than the typical "hello world" program. Prompt the user to enter 2 integer numbers that are not negative. After either entry, display that number again. Print the smaller in hexadecimal, in decimal, and in octal format. Include...

  • In C++ 2. Write a program that allows the user to enter a series of positive...

    In C++ 2. Write a program that allows the user to enter a series of positive numbers between 1 and 100 and displays the smallest and largest of the numbers entered. The program should not store the numbers that were entered, only keep track of the smallest and largest ones. The program should continue accepting numbers until the value 0 is entered and then display the results. If a number out of range is entered, tell the user it is...

  • In c++ please .. Write a program that prompts the user to enter a four-digit integer...

    In c++ please .. Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order.

  • a. Design the logic for a program that allows a user to enter 12 numbers, then...

    a. Design the logic for a program that allows a user to enter 12 numbers, then displays them in the reverse order of entry. b. Modify the reverse-display program so that the user can enter any amount of numbers up to 12 until a sentinel value is entered. ( I really could use more of a pseudocode rather than actual code. also an explanation of each step. The answer I got last time was just c++ code that including a...

  • Write a java program that asks the user to enter an integer. The program should then...

    Write a java program that asks the user to enter an integer. The program should then print all squares less than the number entered by the user. For example, if the user enters 120, the program should display 0, 1, 4, 9, 16, 25, 36, 49, 64, 81, and 100.

  • Write a C++ program to allow an user to enter username and password, and then compare...

    Write a C++ program to allow an user to enter username and password, and then compare the entered values with the values which stored in a file called login.txt. Display an message "Login successful" if the values are matched, otherwise display "Login fail!. This program allow the user to have three times of tries, if exceeded the number of times, display a message "Number of times is exceeded, please contact administrator (Assume, the stored username is "INTI-IU and password is...

  • In Python 3, Write a program that reads a set of floating-point values. Ask the user...

    In Python 3, Write a program that reads a set of floating-point values. Ask the user to enter the values, then print: The number of values entered. The smallest of the values The largest of the values. The average of the values. The range, that is the difference between the smallest and largest values. If no values were entered, the program should display “No values were entered” The program execution should look like (note: the bold values are sample user...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT