Home Forums C Programming please help me Re: Re: please help me

#3476
GWILouisaxwzkla
Participant

Could do:


/****************************************************************
* File Name : c:programshelptempCG.cpp
* Date : November,17,2008
* Comments : new project
* Compiler/Assembler :
*
*
*
*
*
* Program Shell Generated At: 3:18:48 p.m.
=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/


#include
//#include
//#include
//#include
//#include
//#include



//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ FUNCTION PROTOTYPES @@@@@@@@@@@@@@@@@@@@@@@@@@



//##################################################################################


//main function ******************************

int main ( )
{

int result;
int fail = 0 , pass = 0;
char newline;

printf ( "Enter Result (1=pass, 2fail , 3=quit: )");
scanf ( "%i", & result );
scanf ( "%c", & newline); //get newline out of stream ( enter key )
while ( result != 3 )
{
if ( result == 1 )
pass ++;
else if ( result == 2 )
fail ++;

printf ( "Enter Result (1=pass, 2fail , 3=quit: ");
scanf ( "%i", & result );
scanf("%c", &newline); //get newline out of stream ( enter key )
}


printf ( "pass = %i n" , pass );
printf ( "pass = %i n" , fail );


return 0 ;
}