Can you use, if and else statements in the while loop?

Get Michael Jones from the C message board, his email is there and tell him to come here, every is posting about C in this board, and this board needs him


Comments

  • here's a simple example:


    int num1;


    do

    {

    cout << "Enter a number";<br>
    cin >> num1;

    if(num1 >45)

    cout << "blah" << endl;<br>
    else

    cout << "blahblahblah" <<endl;<br>
    } while (num1 != 0);


    simple, no?




  • here's a simple example:


    int num1;


    do

    {

    cout << "Enter a number";<br>
    cin >> num1;

    if(num1 >45)

    cout << "blah" << endl;<br>
    else

    cout << "blahblahblah" <<endl;<br>
    } while (num1 != 0);


    simple, no?




  • here's a simple example:


    int num1;


    do

    {

    cout << "Enter a number";<br>
    cin >> num1;

    if(num1 >45)

    cout << "blah" << endl;<br>
    else

    cout << "blahblahblah" << endl;<br>
    } while (num1 != 0);







  • here's a simple example:


    int num1;


    do

    {

    cout << "Enter a number";<br>
    cin >> num1;

    if(num1 >45)

    cout << "blah" << endl;<br>
    else

    cout << "blahblahblah" << endl;<br>
    } while (num1 != 0);







Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories