Jesper de Jong wrote:Have you tried running the program and entering some numbers?
It will print "Odd" for even numbers, and "Even" for odd numbers. Isn't that odd?
Avinash Oak wrote:Hi, I think its solved, please have a look on my code and check if there still any bug.
and below is the output:
Avinash Oak wrote:also there is another problem, I cann't use "num" variable without initialization.
Buenny Fry wrote:
Avinash Oak wrote:also there is another problem, I cann't use "num" variable without initialization.
It seems to work fine without having to initialize it. I just removed the "=0" part and it still ran. What kind of error did you receive?
Avinash Oak wrote:But can it prompt for "enter number" again after user entered a non-numeric value?
"Leadership is nature's way of removing morons from the productive flow" - Dogbert
Articles by Winston can be found here
Don't get me started about those stupid light bulbs. |