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
Phoenix [80]
2 years ago
12

If you want a user to enter exactly 20 values which loop would be the best to use

Computers and Technology
1 answer:
miskamm [114]2 years ago
3 0
The answer to this is 'for'
You might be interested in
write a c++ program that reads from the user a positive integer (in a decimal representation), and prints its binary (base 2) re
Vesna [10]

Answer:

The program to this question can be described as follows:

Program:

#include <iostream> //defining header file

using namespace std;

int main() //defining main method

{

int x1,rem,i=1; //defining integer variable

long Num=0;// defining long variable

cout << "Input a decimal number: "; // print message

cin >> x1; //input value by user

while (x1!=0) //loop for calculate binary number

{

//calculating binary value    

rem= x1%2;

x1=x1/2;

Num =Num +rem*i;//holding calculate value

i=i*10;

}

cout <<Num;//print value

return 0;

}

Output:

Input a decimal number: 76

1001100

Explanation:

In the above code, four variable "x1, rem, i, and Num" is declared, in which three "x1, rem, and i" is an integer variable, and one "Num" is a long variable.

  • In the x1 variable, we take input by the user and use the while loop to calculate its binary number.
  • In the loop, first, we check x1 variable value is not equal to 0, inside we calculate it binary number that store in long "Num" variable, after calculating its binary number the print method "cout" is used to prints its value.  
5 0
3 years ago
What makes us see continuously moving images when still images appear in rapid succession
Sav [38]
Animations and frames?
8 0
2 years ago
What is the oldest malware victor
arsen [322]

Answer:

The oldest malware vector was emails.

Explanation:

Websites were not widespread early on into the internet, however it was very easy to have a virus that uses an email contact list, where it can send itself to other email addresses and spread.

7 0
3 years ago
3. Write a method squareOfAsterisks that displays a solid square (the same number of rows and columns) of asterisks whose side i
iren2701 [21]

Answer:

Following are the program to this question:

#include <iostream>//defining header file

using namespace std;

void squareOfAsterisks(int x) //defining method squareOfAsterisks

{

   int i,j; //defining integer variable

   for(i=1;i<=x;i++) //defining loop to print column value

   {

   for(j=1;j<=x;j++) //defining loop to print row value

   {

   cout<<"*"; //print value

   }

   cout<<endl; //for line break

   }

}

int main() //defining main method

{

int x; //defining integer variable

cout<<"Enter any number: "; //print message

cin>>x; //input value from user

squareOfAsterisks(x); //calling the method and pass the value

return 0;

}

Output:

Enter any number: 4

****

****

****

****

Explanation:

The description of the above program can be given as follows:

  • In the given program a method "squareOfAsterisks" is declared, that accepts an integer value "x" in its arguments, inside the method two integer variable I, j is used, that uses a to print the given pattern.
  • In the main method, an integer variable x is declared, which takes input from the user end, and then calls the method, that is "squareOfAsterisks" and passes its value.
8 0
2 years ago
Describe how an alpha channel and masking color control image transparency.
Stella [2.4K]
Answe:

Control image transparency
3 0
2 years ago
Other questions:
  • What is software that, while purporting to serve some useful function and often fulfilling that function, also allows Internet a
    11·1 answer
  • What is the purpose of the .NET Framework Class Library? a. it provides pre-written code that can be used by .NET applications b
    13·1 answer
  • Computers help eliminate the repetitiveness of manual tasks. How can this benefit you in your overall career?
    9·2 answers
  • Write two examples of hard copy output?​
    9·1 answer
  • Working with do-while loop
    9·1 answer
  • Which software programs should students avoid using to create and submit course work? (Choose all that apply). Word, Pages, Numb
    13·1 answer
  • Help me please. I'LL MARK BRAINIEST
    15·1 answer
  • Discuss seven multimedia keys​
    8·1 answer
  • A(n) ________ is a box consisting of a radio receiver/transmitter and antennas that links to a wired network, router, or hub.
    11·1 answer
  • Task 04
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!