how to compare an input character
for example: input is 'c'
if the input is 'c'
print "123"
else
print "456"
how to compare an input character
for example: input is 'c'
if the input is 'c'
print "123"
else
print "456"
Code:ch = getchar(); if ( ch == 'c' ) { printf( "123\n" ); } else { // ... }
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
Originally posted by Salem
Code:ch = getchar(); if ( ch == 'c' ) { printf( "123\n" ); } else { // ... }
thank you very much