Jump to content

if expression

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Bertan

Bertan

    Learning Programmer

  • Members
  • PipPipPip
  • 43 posts
I need help with just a small thing, I searched google but cant find anything about it. I have a menu with the option to go to three other menus. 21,22 and 23 get the user to the different menus. If any other numbers are typed the user gets a "wrong typed message". How can I do to include letters in this if expression? " if (tal>23 || tal<21|| any letter) "


if (tal == 21)		{menu1();}    

if (tal == 22)		{menu2();}

if (tal == 23)		{menu3();}   

if (tal>23 || tal<21)	{wrongtype();}



#2
Flying Dutchman

Flying Dutchman

    Programming God

  • Members
  • PipPipPipPipPipPipPip
  • 889 posts
  • Location:::1
if (tal > 23 || tal < 21 || (tal >= 'a' && tal <= 'z' || tal >='A' && tal <= 'Z'))

A conclusion is where you got tired of thinking.
#define class struct    // All is public.




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users