Members BookmarksPolls Fresher Jobs Funny Photos B.Tech Projects New Member FAQ  



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

Advertisements


website counter



C Concept-if-else statement


Posted Date: 12 Jun 2008    Resource Type: Articles/Knowledge Sharing    Category: Computer & Technology

Posted By: Girish Patil       Member Level: Diamond
Rating:     Points: 4



THE if-else STATEMENT
Introduction
When you want to take actions based on the outcome of the conditions, (true or false), then you can use the if-else statement.

Program/Example
The general format for an if-else statement is

if (condition)
simple or compound statement // s1
else
simple or compound statement. // s2

If the condition is true then the s1 part is executed and if the condition is false then the s2 part is executed. For example,

if (a>b)
printf (" big number is %d", a); // s1
else
printf (" big number is %d", b); // s2

if a is greater than (b) then s1 is executed. Otherwise s2 is executed.



--------------------------------------------------------------------------------




Responses

Author: Tejwant Singh Randhawa    16 Jun 2008Member Level: Silver   Points : 1
when you want to make decision between true & false then we use if statement.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: C Concept-The if Statement
Previous Resource: C Concept-The switch Statement
Return to Discussion Resource Index
Post New Resource
Category: Computer & Technology


Post resources and earn money!
 
Related Resources


Contact Us    Privacy Policy    Terms Of Use   

SpiderWorks Technologies Pvt Ltd. 2006 - 2007 All Rights Reserved.