Home › Forums › C Programming › beginners needs help › Re: Re: beginners needs help
December 29, 2009 at 5:08 pm
#3616
GWILouisaxwzkla
Participant
could try:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | <br /> <br /> /****************************************************************<br /> * File Name : c:programstempCG.cpp<br /> * Date : December,29,2009<br /> * Comments : new project<br /> * Compiler/Assembler : Visual C++ 6.0<br /> * Modifications :<br /> *<br /> *<br /> *<br /> *<br /> *<br /> * Program Shell Generated At: 11:37:28 a.m.<br /> =-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/<br /> <br /> <br /> #include < iostream ><br /> //#include < string.h ><br /> //#include < conio.h ><br /> //#include < math.h ><br /> //#include < iomanip ><br /> //#include < ctype.h ><br /> <br /> using namespace std;<br /> <br /> //main function ******************************<br /> <br /> int main ( )<br /> {<br /> <br /> int input;<br /> int numberOfInputItems;<br /> int numberCount = 0;<br /> <br /> cout << "Enter number of items to input: ";<br /> cin >> numberOfInputItems;<br /> <br /> int i = 0;<br /> while ( i < numberOfInputItems )<br /> {<br /> cout << "enter a number: ";<br /> cin >> input;<br /> if ( input == 1 || input == 4 || input == 5 || input == 12 ||<br /> input == 6 || input == 3 )<br /> numberCount ++;<br /> i ++;<br /> }<br /> <br /> cout << endl;<br /> cout << "The count was " << numberCount << endl;<br /> }<br /> <br /> |