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
To input lenth in meter and convert in to centimeter​
Scorpion4ik [409]

Answer:

multiply the number of meters by 100 and change the units to cm

Explanation:

hope this helped :D

5 0
3 years ago
Convert 3BA.25 (base 14) to base 6 ? Show all arithmetic in decimal
Irina18 [472]

Answer:

(3252.1001)_{6}

Explanation:

  • To convert the base 14 to base 10 :

(3BA.25)_{14}= 3*14^{2} + B*14^{2} + A*14^{0} + 2*14^{-1} + 5*14^{-1}

Then,    = 588+154+10+\frac{2}{14^{1}} + \frac{5}{14^{2}}

Then,    =752 + 0.168

            =(752.168)_{10}

  • To convert base-10, [text](752.168)_{10}[/text] to base 6.

     6 | 752 | 2

     6 | 125 | 2

     6 | 20  | 2

     6 | 3    | 3

        | 0    |

Then, the conversion part 752 which has base-6 = 3252

  • Then, the conversation of the decimal part .168 to base 6

0.168*6=1.008 and the integer part is 1.

0.008*6=0.048 and the integer part is 0.

0.048*6=0.288 and the integer part is 0.

0.288*6=1.728 and the integer part is 1.

Then, the conversion of decimal part is (0.1001)_{6}

Finally, the answer is  (3252.1001)_{6}

6 0
3 years ago
Which of the following best defines natural selection?
Vsevolod [243]
The answer is differential success in some organisms reproduction due to traits that favor survival <span />
6 0
3 years ago
Which group on the home ribbon contains commands to control the alignment of text in a document?
Aleksandr-060686 [28]
Q.) Which group on the home ribbon contains commands to control the alignment of text in a document?
A.) Paragraph 
3 0
4 years ago
A(n) ________ is a navigation aid that shows the path you have taken to get to a web page or where the page is located within th
kenny6666 [7]

The answer would be breadcrumb trail.

8 0
4 years ago
Read 2 more answers
Other questions:
  • An engineer is assigned to replace an older data-grade autonomous wireless network with a cisco controllerbased wireless network
    6·1 answer
  • Computer a has an overall cpi of 1.3 and can be run at a clock rate of 600mhz. computer b has a cpi of 2.5 and can be run at a c
    11·1 answer
  • Create a horizontal line across middle of the entire form. To code this the ____ values are the same.
    7·2 answers
  • What is modularity? Help asap
    9·1 answer
  • What software could i use to create music like Aphex Twin?
    6·1 answer
  • Assume hosts A and B are each connected to a switch Svia 100-Mbps links. The propagation delay on each link is 25μs. The switch
    15·1 answer
  • 21
    5·1 answer
  • How do I use brainly.<br> What is brainliest.<br> And what is the rating thing about
    6·2 answers
  • The cameras picture review function allows you to look at the _ you've taken
    8·1 answer
  • Computer science - algorithms - flowcharts
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!