Home › Forums › C Programming › please help me about turbo c prog problem?
- This topic has 1 reply, 2 voices, and was last updated 16 years, 1 month ago by GWILouisaxwzkla.
Viewing 1 reply thread
- AuthorPosts
- November 16, 2008 at 10:05 am #2155TobiasForanParticipant
can anyone to help me about this turbo c prog problem??
here is the output..
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 2
Enter Result (1=pass, 2fail): 2
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 2
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 1
Enter Result (1=pass, 2fail): 2Passed: 6
Failed: 4======
tnx please help me guys…thank you - November 17, 2008 at 8:41 pm #3476GWILouisaxwzklaParticipant
Could do:
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758<br />/***************************************************************** File Name : c:programshelptempCG.cpp* Date : November,17,2008* Comments : new project* Compiler/Assembler :****** Program Shell Generated At: 3:18:48 p.m.=-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/#include <stdio.h>//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 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 ;}
- AuthorPosts
Viewing 1 reply thread
- The forum ‘C Programming’ is closed to new topics and replies.