Looking for a Tutor Near You?

Post Learning Requirement »
x

Choose Country Code

x

Direction

x

Ask a Question

x

x
x
x
Hire a Tutor

The C Programming Language -Chapter 4 (Part 4)

Loading...

Published in: C / C++
208 Views

Here I explained the Decision making method of C programming. It is called If . statement . Its are 4 types . So, I uploaded 4 PPT. Thanking you

Uma / Madurai

3 years of teaching experience

Qualification: M.Sc (Rena Infotech, Cheranmahadevi - 2013)

Teaches: Advanced Excel, Basic Computer, Computer for official job, MS Office, School Level Computer, All Subjects, Biology, Computer Science, History, Social Studies, Geography, B.Sc Tuition, B.Tech Tuition, IT, M.Sc Tuition, C / C++, Java And J2EE, Visual Basic

Contact this Tutor
  1. C — Statements (4. Nested If statement)
  2. Nested If Statement The if...else statement executes two different codes depending upon whether the test expression is true or false. Sometimes, a choice has to be made from more than 2 possibilities. The if...else ladder allows you to check be een multiple test expressions and execute differen statements.
  3. Syntax if (condition]) V/ Executes when condition] is true if (condition2) { // Executes when condition2 is true else { // Executes when condition2 is false
  4. Example // C program to Illustrate nested-if statement #include <stdio.h> int main() int i if (i = 10) { // First if statement 15) printf("i is smaller than 15\n"); // Nested - if statement // Will statement above // is true if 2) printf("i is smaller than 12 too\n't); else printf("i is greater than 15"); return 0;
  5. Output i is smaller than 15 Mis smaller than 12 too