Ask Question
14 August, 21:10

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

+2
Answers (2)
  1. 14 August, 22:08
    0
    So the given program: 1 2 3 4

    i=1

    User num=4#assume positive

    While (user-num>=i);

    print (i)

    i+=1

    #include

    using namespace std;

    int main ()

    {int userNum=0;

    int i=0;

    userNum=4; ##assume positive

    i=1;

    while (i <=userNum) {

    cout<>" ";

    i=i+1;

    cout <
    return0; }
  2. 14 August, 23:42
    0
    Given 1234

    i=1

    user num=4#assume positive

    while (user-num>=i);

    print (i)

    i+=1

    #include

    using namespace std;

    int main ()

    {int userNum=0;

    int i=0;

    userNum=4; ##assume positive

    i=1;

    while (i <=userNum) {

    cout<>" ";

    i=i+1;

    cout <
    return0;

    }
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Write a while loop that prints 1 to user_num. Sample output for the given program: 1 2 3 4 ...” in 📙 Computers & Technology if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers