Question

Write a full C++ program to read a series of integer numbers from standard input and...

Write a full C++ program to read a series of integer numbers from standard input and print them out in reverse order, one per line. You may assume that there will be a minimum of 2 numbers to read and a maximum of 200.

Homework Answers

Answer #1

#include <iostream>

using namespace std;

int main()
{
int n;
cout<<"how may numbers you want to take : ";
cin>>n;
int arr[n];
cout<<"Enter Elements : ";
for(int i=0;i<n;i++)
{
cin>>arr[i];
}
  
for(int j=n-1;j>=0;j--)
{
cout<<arr[j]<<endl;
  
}

return 0;
}

if you have any doubts ask me..

Know the answer?
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
Similar Questions
Write a C++ program that reads integers from standard input until end of file. Print out...
Write a C++ program that reads integers from standard input until end of file. Print out the largest integer that you read in, on a line by itself. Any erroneous input (something that is not an integer) should be detected and ignored. In the case where no integers are provided at all, print NO INTEGERS and stop.
Write a C++ program that reads integers from standard input until end of file. Print out...
Write a C++ program that reads integers from standard input until end of file. Print out the largest integer that you read in, on a line by itself. Any erroneous input (something that is not an integer) should be detected and ignored. In the case where no integers are provided at all, print NO INTEGERS and stop Remember, try not to do the entire job all at once! First try input of a single number and make sure it works....
 Write a program to find the prime numbers - Ask user to input the integer...
 Write a program to find the prime numbers - Ask user to input the integer number - test the number whether it is a prime number or not - Then, print “true” or “false” depending on whether the number is prime or isn’t. - Hint: number is prime when is has exactly 2 factors: one and itself. By this definition, number 1 is a special case and is NOT a prime. - Use idea of user input, cumulative sum,...
Write a program in C++ that reads integer values from standard input and writes to standard...
Write a program in C++ that reads integer values from standard input and writes to standard output the smallest of the inputs and the average input value. The program should stop reading when a value equal to -1 or greater than 100 is encountered. It should also stop when an incorrect integer value (i.e., anything that isn't an int) is entered. If there is not an integer value in the input, the program should output "no integers provided"
Write a program to take input of two integer variable a and b. After taking input...
Write a program to take input of two integer variable a and b. After taking input of these variables print all the palindrome numbers from a to b. I need this is C programming language.
Write a C program to read in one or more files then store each line of...
Write a C program to read in one or more files then store each line of the contents of them in a linked list and then print them out in sorted order Example: file1.txt contains: 3 7 9 6 Sorted: 3 6 7 9
Write an assembly program that reads characters from standard input until the “end of file” is...
Write an assembly program that reads characters from standard input until the “end of file” is reached. The input provided to the program contains A, C, T, and G characters. The file also may have new line characters (ASCII code 10 decimal), which should be skipped/ignored. The program then must print the count for each character. You can assume (in this whole assignment) that the input doe not contain any other kinds of characters.  the X86 assembly program that simply counts...
write a C program that declares an integer variable called "favorite_number". The program should then prompt...
write a C program that declares an integer variable called "favorite_number". The program should then prompt the user to enter their favorite number, and use scanf to read the user's input into favorite_number. Finally, the program should print a message that includes the user's input.
write C program using function to read 20 float numbers and print the average of them...
write C program using function to read 20 float numbers and print the average of them after changing the negative to positive number.
Using Java Write a program that reads a file of numbers of type int and outputs...
Using Java Write a program that reads a file of numbers of type int and outputs all of those numbers to another file, but without any duplicate numbers. You should assume that the input file is sorted from smallest to largest with one number on each line. After the program is run, the output file should contain all numbers that are in the original file, but no number should appear more than once. The numbers in the output file should...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT