Link to home
Start Free TrialLog in
Avatar of kensy11
kensy11Flag for Belgium

asked on

if else if quastion

Hallo, i have a quastion about if else if

what is de diffrence between this code

{ if (hoofdletter)
                  printf("is een hoofdletter en ");
                  printf("het is een letter");                  
            }

and this

 if (hoofdletter){
                  printf("is een hoofdletter en ");
                  printf("het is een letter");                  
            }

and why is it that i cont use else if when i use this code

 if ((hoofdletter=(toets > 'A' && toets < 'Z' ))|| toets > 'a' && toets < 'z')
               printf("het is een letter");
             { if (hoofdletter)
                  printf("is een hoofdletter en ");

             }
         else /* if i use else if here ik get an error */
            if (toets >= '0' && toets <='9')
               printf("het is een nummer");


but here i dont get an error

 if ((hoofdletter=(toets > 'A' && toets < 'Z' ))|| toets > 'a' && toets < 'z')
               
             { if (hoofdletter)
                  printf("is een hoofdletter en ");
                  printf("het is een letter");                  
             }
         else
            if (toets >= '0' && toets <='9')
               printf("het is een nummer");


Sorry if its a long quastion ,
SOLUTION
Avatar of Adrian Cantrill
Adrian Cantrill
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial