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 1)

Loading...

Published in: C / C++
275 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 (1. If statement)
  2. 2. 3. 4. 5. 6. If Statement An if statement consists of a Boolean expression followed by one or more statements. You have already learned that C supports the usual logical conditions from mathematics: Less than: a < b Less than or equal to: a <= b Greater b Greater than or equal to: a >= b Equal to a b Not Equal to: a != b
  3. Structure of if statement Condition True if Condition username code
  4. Syntax if (condition) { // block of code to be executed if the condition is true
  5. Example // Program to display a number if it is negative #include <stdio.h> •ntunain() int number; printf("Enter an integer: "); &number); // Oue if number is less than 0 if (number < 0) { is easy"); return 0;
  6. Output 1) Enter an integer: -2 You entered -2. The if statement is easy.