Do In Lab (11-02-2013)

Post date: Feb 11, 2013 6:01:41 AM

Q1: write a c++ program, use while loop to enter a number, and the loop works 

        continuously until you enter an even number.

        --------------------------------------------

            Enter a number : 1

            Enter a number : 5

            Enter a number : 9

            Enter a number : 2

            Press any key to continue...

Q2: write a c++ program that enables you to enter numbers one by one, 

        the program stores negative numbers on a file and if a positive number entered the program will exit.

        --------------------------------------------

            Enter a number : -22

            Enter a number : -35

            Enter a number : -9

            Enter a number : 2

            Press any key to continue...

Q3: write a c++ program loop that works [from 1 to 10] and only prints numbers that are even. 

        --------------------------------------------

            2 4 6 8 10

            Press any key to continue...