Decision Control (Or) Decision Making Statements
Characteristics of a simple type program
Different types of decision control statements (or) Decision Making Statements
In C, the different kinds of decision control statements (or) Decision Making Statements are namely
Rule of expressing a condition or decision
As a general rule, express a condition using C’s relational operators. The relational operators allow us to compare two values to see whether they are equal to each other, unequal or whether one is greater than the other. The condition always enclosed within a pair of parentheses. Example: (n>0) Relational condition - always yields a value true (1) or false (0) Some examples of decision making, using if statement are:
1. if (sex is m) Person is male 2. if (age is greater than 58) Person is retried
|
Review Questions
Review Questions
To really use the power of the C language, your programs need to make decisions. A computer can't think, but it can make comparisons, evaluate the results of the comparisons, and then act on that information. The if keyword is used in C programming to make comparisons and control the flow of your program.
This is a conditional statement used in C to check condition or to control the flow of execution of statements. This is also called as 'decision making statement or control statement.' The execution of a whole program is done in one direction only.
Review Questions
1.What is the important function of if statement? 2.Define conditional branching. 3.Give an example for conditional branching. 4.Why if is a selection statement? This is the most simple form of the branching statements.
The if statement controls conditional branching. The most basic kind of conditional branch is the if statement. In conditional branching statement a condition is evaluated, if it is evaluate true a group of statement is executed. If statements allow the flow of the program to be changed, which leads to more interesting code.
An if statement is a selection statement The keyword if tells the compiler that what follows is decision control statement. Review Questions
Review Questions
Components of Simple-if with Single Statement
Review Questions
|
- Home
-
C Language
- C++
- Java
-
B.C.A
- Subject Details
- COBOL
- Digital Logic Fundamentals
- Fundamental of Digital Computers
- Microprocessor and its applications
- Programming in C
- Computer Graphics
- Operating System
- Programming in C++ and Data Structures
- DBMS
- Programming in Java
- Data Communication and Networking
- Software Engineering
- Software Testing
- Web Technology
- Elective - I >
- Elective - II >
- Elective - III >
- Maths Questions >
- English
-
B.Sc
- B.Sc (Cs) Subject Details
- Computer Architecture and Organization
- Digital Electronics and Microprocessor
- Data Structure Using C++
- Microprocessor and Its Applications
- Programming in C
- Programming in C++ and Data Structures
- Programming in Java
- Visual Programming
- Operating System
- DBMS
- Software Engineering
- Data Communication and Networking
- Software Testing
- Web Technology
- Computer Networks
- OOAD
- Multimedia Systems
- M.C.A
- M.Sc (CS)
- M.Sc (IT)
- Conduct Us
- Programming Language
- Programming Logic
- Computer Terms
- Job Selection Process
- Learn English Using Tamil
- Spoken English in Tamil
- Conversational Tamil
- English
- Interview