Armor3127 Armor3127
  • 20-06-2018
  • Computers and Technology
contestada

Write a while loop that prints 1 to user_num. Sample output for the given program: 1 2 3 4

Respuesta :

jamuuj jamuuj
  • 03-07-2018
Given 1234
i=1
user num=4#assume positive
while (user-num>=i);
print(i)
i+=1
#include <iostream>
using namespace std;
int main()
{int userNum=0;
int i=0;
userNum=4; ##assume positive
i=1;
while (i <=userNum){
cout<<i>>" ";
i=i+1;
cout <<endl;
return0;
}
Answer Link
zainebamir540
zainebamir540 zainebamir540
  • 10-02-2019

Answer:

So the given program: 1 2 3 4

i=1

User num=4#assume positive

While (user-num>=i);

print(i)

i+=1

#include <iostream>

using namespace std;

int main()

{int userNum=0;

int i=0;

userNum=4; ##assume positive

i=1;

while (i <=userNum){

cout<<i>>" ";

i=i+1;

cout <<endl;

return0;}



Answer Link

Otras preguntas

Estimate by first rounding each number to the nearest 1/2. -3 8/9 * 1 1/2 A. –6 B. –3 C. 6 D. 8
Graph the system of linear inequalities 2x-2y<6 X-y<9
what is the decimal of 130 cents like money but in decimal form
what is the answer to 240in.= ft.?
HELP PLEASE SOME ONE HELP ME PLEASEEEEEEEEEEThe manager of a sawmill wants to find out what percentage of the boards that the mill produced are defective. Which
1/2 + 1/3 - 1/4 = I don't know
The light bulb was an innovation of A. Guglielmo Marconi B. Thomas Edison C. Alexander Graham Bell D. Jean Lenoir E. Gustav Eiffel
Environmentalists in Florida are against offshore drilling in the Gulf of Mexico MAINLY because the drilling might A) polluted beaches. B) emit carbon dioxide
decrease 28 by 7% immmmmmmmmm soooooooo stuck
what unit would be used to measure the weight of a small bag of rice