Sunday, 24 May 2015

  • Sunday, May 24, 2015

Chapter 10


C - Decision Making


Decision making structures require that the programmer specify one or more conditions to be evaluated or tested by the program, along with a statement or statements to be executed if the condition is determined to be true, and optionally, other statements to be executed if the condition is determined to be false.
Following is the general form of a typical decision making structure found in most of the programming languages:
Decision making statements in C
C programming language assumes any non-zero and non-null values as true, and if it is either zero or null, then it is assumed as false value.
C programming language provides following types of decision making statements. Click the following links to check their detail.
StatementDescription
An if statement consists of a boolean expression followed by one or more statements.
An if statement can be followed by an optional else statement, which executes when the boolean expression is false.
You can use one if or else if statement inside another ifor else if statement(s).
switch statement allows a variable to be tested for equality against a list of values.
You can use one switch statement inside another switchstatement(s).

The ? : Operator:

We have covered conditional operator ? : in previous chapter which can be used to replace if...else statements. It has the following general form:
Exp1 ? Exp2 : Exp3;
Where Exp1, Exp2, and Exp3 are expressions. Notice the use and placement of the colon.
The value of a ? expression is determined like this: Exp1 is evaluated. If it is true, then Exp2 is evaluated and becomes the value of the entire ? expression. If Exp1 is false, then Exp3 is evaluated and its value becomes the value of the expression.

Related Posts:

  • Taurus Horoscope 2015 Taurus horoscope 2015 astrology predictions are based on your Moon sign. Create your birth chart at HindiKundli.com and know your Moon sign to read 2015 Taurus horoscope. Taurus 2015 horoscope is the detailed astrological p… Read More
  • Aries Horoscope 2015 Aries horoscope 2015 astrology predictions are based on your Moon sign. Create your birth chart at HindiKundli.com and know your Moon sign to read 2015 Aries horoscope. Aries 2015 horoscope is the detailed astrological p… Read More
  • राशिफल 2015 "Horoscope 2015" Click here to read in English - Horoscope 2015  यह राशिफल 2015 बचाएगा आपको बाधाओं से, टालेगा संकट और दिखलाएगा उन्नति का मार्ग। इस भविष्यकथन के माध्यम से आप जानेंगे 2015 के गर्भ में छुपे रहस्य औ… Read More
  • Cancer Horoscope 2015 Cancer horoscope 2015 astrology predictions are based on your Moon sign. Create your birth chart at HindiKundli.com and know your Moon sign to read 2015 Cancer horoscope. Cancer 2015 horoscope is the detailed astrological p… Read More
  • Gemini Horoscope 2015 Gemini horoscope 2015 astrology predictions are based on your Moon sign. Create your birth chart at HindiKundli.com and know your Moon sign to read 2015 Gemini horoscope. Gemini 2015 horoscope is the detailed astrological p… Read More
Related Posts Plugin for WordPress, Blogger...

Vacancy

RBI has announced the recruitment for 134 GRADE B OFFICERS.
 The examination will be in two phases.
 The detailed advertisement will be published on 5th October.

Popular Posts