Follow Us on:
Home
About Us
Staff
Current Events
Forum
Tutorials
C Language
>
Operators
Data Types
Decision Making
Looping Statements
Gotoxy and Textcolor
Array
Java
HTML/XHTML
CSS
>
CSS Syntax
CSS Id and Class
CSS How To
Photoshop
Visual Basic
CPP Programming
Resources
Downloads
C Language
Decision Making
If statement
Syntax:
if(conditional/relational statement)
statement;
Example:
if(grade >= 75)
printf("PASSED");
if - else statement
Syntax:
if(conditional/relational statement)
statement1;
else
statement2;
Example:
if(grade >= 75)
printf("PASSED");
else
printf("FAILED");
if - else if statement
Syntax:
If(conditional/relational statement)
statement1;
else if(conditional/relational statement)
statement2;
else
statement3;
Example:
if(code == 'J' || code == 'j')
printf("JAVA");
else if(code == 'T' || code == 't')
printf("TURBO C");
else if(code == 'V' || code == 'v')
printf("VISUAL BASIC");
else if(code == 'P' || code == 'p')
printf("PHP");
else
printf("Unlisted!");
switch statement
Syntax:
switch(var)
{ case
value1;
statement;
break;
case
value2;
statement;
break;
case
value3;
statement;
break;
default:
statement;
}
Quick Links
Operators
Data Types
Decision Making
Looping Statements
Gotoxy & Textcolor
Array