Welcome

Hi! This blog is for beginners of c++ and java .You can check and pick codes for your programming assignments. This will also help you to understand the concepts of these programming languages. Its all about programming.

Loops Practise(positive number)

Wednesday, May 18, 2011

#include <iostream.h>
int main ()
{
    int number;
    cout <<"ENTER POSITIVE NUMBER\n";
    cin >> number;
    while (number<0)
    {
        cout <<"NUMBER MUST BE POSITIVE\n";
        cout <<"PLEASE RE-ENTER : ";
        cin >> number;
    } // end while

    }