Electronics Circuits & Tutorials
Electronics Circuits & Tutorials

Tutorials

     more....

Dictionaries

     more....

Projects
Home > Electronics Tutorials > C Language Tutorial > Statements - if

C Language Programming Library Reference Guide

Statements - if

The if statement evaluates an expression. If that expression is true, then a statement is executed. If an else clause is given and if the expression is false, then the else's statement is executed.

Syntax:
 

if( expression ) statement1;

or

if( expression ) statement1;
else statement2 ;
 
Examples:
 
if(loop<3) counter++;

if(x==y)
  x++;
else
  y++;

if(z>x)
 {
  z=5;
  x=3;
 }
else
 {
  z=3;
  x=5;
 }
Note: To report broken links or to submit your projects, tutorials please email to Webmaster

Circuits
A B C D
E F G H
I J K L
M N O P
Q R S T
U V W X
Y Z
Discover

     more......

Copyright © 1999-2011 www.hobbyprojects.com  (All rights reserved)