C/C

Advertisement


Question
Write a program which allows the user to enter characters
until the input is 0.Each time a character is entered, the
program should display whether it is greater or lesser than or
equal to the previous character entered

Answer
Hello Aparajita

For ethical reasons, I am not going to write the program for you. I will help you if you show me some effort.

Here is some advice. In your program be sure to include <stdio.h>. Create a main program with a while loop. In the while loop call getc(stdin) to get a character. The getc() is a standard C function. Read about getc at
http://www.cplusplus.com/reference/clibrary/cstdio/getc/

You will need an integer to hold the getc result. You will also need an integer to hold the previous (older) getc result so that you can compare them. I hope that will get you started.

Best regards
Zlatko

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Zlatko

Expertise

No longer taking questions.

Experience

No longer taking questions.

Education/Credentials
No longer taking questions.

©2012 About.com, a part of The New York Times Company. All rights reserved.