2. Write a program in C++ that: a) Declares a 1D array A with 30 elements b)...

90.2K

Verified Solution

Question

Programming

2. Write a program in C++ that:

a) Declares a 1D array A with 30 elements

b) Inputs an integer n from 1-30 from the keyboard. If n < 1set n = 1. If n > 30 set n = 30.

the program should keep asking the user the input n one by one,followed by printing of the value of n (n=n if bigger than 1 andsmaller than 30, 1 if smaller than 1 and 30 if bigger than 30)

Answer & Explanation Solved by verified expert
3.6 Ratings (467 Votes)
include using    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students