1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
IrinaK [193]
3 years ago
9

Write a for loop to populate array userGuesses with NUM_GUESSES integers. Read integers using cin. Ex: If NUM_GUESSES is 3 and u

ser enters 9 5 2, then userGuesses is {9, 5, 2}. for C++
Computers and Technology
1 answer:
vlabodo [156]3 years ago
6 0

Answer:

Follows are the code to this question:

#include <iostream>//defining header file

using namespace std;

int main() //defining main method

{

const int NUM_GUESSES = 3;//defining an integer constant variable NUM_GUESSES

int userGuesses[NUM_GUESSES];//defining an array userGuesses

int i = 0;//defining integer variable i

for(i=0;i<NUM_GUESSES;i++)//defining for loop for input value

{

cin>>userGuesses[i];//input array from the user end  

}

for (i = 0; i < NUM_GUESSES; ++i)//defining for loop fore print value  

{

cout <<userGuesses[i] << " ";//print array value with a space

}

return 0;

}

Output:

9

5

2

9 5 2  

Explanation:

In the above-given program, an integer constant variable NUM_GUESSES is defined that holds an integer value, in the next step, an integer array "userGuesses" is defined, which holds NUM_GUESSES value.

In the next step, two for loop is defined, in the first loop, it is used for an input value, and in the second loop, it prints the array value.    

You might be interested in
Explain the complement of a number along with the complements of the binary and decimal number systems.why is the complement met
umka2103 [35]

olha so olha la que bacana bonito

3 0
3 years ago
Write the code to call a CSS file named "exam.css".
katen-ka-za [31]

Answer:

 <link rel="stylesheet" href="exam.css">

Explanation:

href is the file name assuming its in the same path

also get an extension called grepper, it helps debug a lot quicker

7 0
2 years ago
Read 2 more answers
What is redo and undo?​
umka21 [38]

Answer:

Answer in the below

Explanation:

Redo means the previous one and undo means removing it... i am not so sure..

3 0
2 years ago
Properties of variable in QBASIC​
Arlecino [84]

Explanation:

assume numeric value and is represented by an alphabet or an alphabet followed by another alphabet or digit. ...

String variable : A string variable is represented by an alphabet followed by dollar ()sign.

4 0
3 years ago
The purpose of a business report is to _____.
mars1129 [50]
Im pretty sure the answer is 2.
4 0
3 years ago
Read 2 more answers
Other questions:
  • What are some ways social media networks make money from users
    10·1 answer
  • Answer: x = 3<br>#1 -2x + 5 = -31​
    10·1 answer
  • What is the defining difference between computer security and information security?
    13·1 answer
  • Stephanie is a zoologist who loves the outdoors and often travels the world researching wildlife and serving as a consultant it
    10·2 answers
  • Please Help
    12·2 answers
  • Chegg A full bootstrap program Select one: a. may be infected by viruses. b. is stored in ROM to ensure to avoid any infection f
    13·1 answer
  • Which benefit does the cloud provide to star-up companies without access to large funding?
    11·1 answer
  • 1. Choose a real or made up company, and describe at least three ways in which the company uses technology. (1-3 sentences. 3.0
    13·1 answer
  • Choose the 3 Points in good story telling
    7·1 answer
  • How long does a seller have to ship an item on offerup
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!