Home › Forums › C Programming › Need help URGENTLY on my assignment (instructions inside) › Re: Re: Need help URGENTLY on my assignment (instructions inside)
March 16, 2009 at 8:40 pm
#3523
GWILouisaxwzkla
Participant
Not totally sure what you need ( not sure what the ‘p’ condition should be ) but heres a start:
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 | <br /> <br /> /****************************************************************<br /> * File Name : c:programstempCG.cpp<br /> * Date : March,16,2009<br /> * Comments : new project<br /> * Compiler/Assembler :<br /> * Modifications :<br /> *<br /> *<br /> *<br /> *<br /> *<br /> * Program Shell Generated At: 3:34:03 p.m.<br /> =-=-=-=-=-=-=-=--=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/<br /> <br /> <br /> #include <br /> //#include <br /> //#include <br /> //#include <br /> //#include <br /> //#include <br /> <br /> using namespace std;<br /> <br /> //main function ******************************<br /> <br /> int main ( )<br /> {<br /> <br /> char hello [ 12 ] = "Hello world";<br /> char ch;<br /> char newline = 10;<br /> <br /> cout < ";<br /> ch = cin.get();<br /> while ( ch != newline )<br /> {<br /> <br /> <br /> if ( ch > 0 && ch < 0 )<br /> cout << "x" << endl;<br /> else if ( ch - '0' >= 0 && ch - '0' <= 11 )<br /> cout << hello [ ch - '0' ] << endl;<br /> else if ( ch - '0' 11 )<br /> cout << "z" << endl;<br /> ch = cin.get();<br /> }<br /> return 0 ;<br /> }<br /> <br /> |