C-Language Lecture By B.S.S.Tejesh, S.Neeraja

Slides:



Advertisements
Similar presentations
Selection Feature of C: Decision making statements: It allow us to take decisions as to which code is to be executed next. Since these statements control.
Advertisements

Decision Structures - If / Else If / Else. Decisions Often we need to make decisions based on information that we receive. Often we need to make decisions.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 5 Selection Statements Animated Version.
©The McGraw-Hill Companies, Inc. Permission required for reproduction or display. Chapter Chapter 5 Selection Statements.
Control Flow Statements: Repetition/Looping
Chapter 13 Control Structures. Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display Control Structures Conditional.
1 Chapter Five Selection and Repetition. 2 Objectives How to make decisions using the if statement How to make decisions using the if-else statement How.
Pascal Programming Today Chapter 4 1 »Conditional statements allow the execution of one of a number of possible operations. »Conditional statements include:
July 13 th.  If/ Else if / Else  Variable Scope  Nested if/else's  Switch statements  Conditional Operator.
Tutorial 12 Working with Arrays, Loops, and Conditional Statements
1 Lecture 8:Control Structures I (Selection) (cont.) Introduction to Computer Science Spring 2006.
Selection Statements choice of one among several blocks of code Java supports 3 kinds of selection statements: if statement – selects one block or leaves.
1 Lecture 7:Control Structures I (Selection) Introduction to Computer Science Spring 2006.
Tutorial 4 Decision Making with Control Structures and Statements Section A - Decision Making JavaScript Tutorial 4 -Decision Making with Control.
UNIT II Decision Making And Branching Decision Making And Looping
Decision Structures and Boolean Logic
Python – Making Decisions Lecture 02. Control Structures A program that only has one flow is useful but limited. We can use if statements to make these.
Syntax : If ( Expression ) If ( Expression ) {Statements; } Example : ?>
ㅎㅎ logical operator if if else switch while do while for Third step for Learning C++ Programming Repetition Control Structures.
Conditional Statement Chapter 8. Conditional Statements Are statements that check an expression then may or may not execute a statement or group of statement.
DEPARTMENT OF COMPUTER SCIENCE & TECHNOLOGY FACULTY OF SCIENCE & TECHNOLOGY UNIVERSITY OF UWA WELLASSA 1 ‏ Control Structures.
Conditional Expression One of the most useful tools for processing information in an event procedure is a conditional expression. A conditional expression.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Chapter 4 Control Structures I. Chapter Objectives Learn about control structures Examine relational and logical operators Explore how to form and evaluate.
Control Flow Statements
CSI 3125, Preliminaries, page 1 Control Statements.
Lesson thirteen Conditional Statement "if- else" ©
The If Statement There are no switch statements in Python. You need to use just if statements. There are no switch statements in Python. You need to use.
Conditional statements and boolean expressions Arithmetic, relational and logical operators.
Chapter 5 – Decision Making. Structured Programming Sequence Selection Repetition yesno yes no.
USING CONDITIONAL CODE AMIR KHANZADA. Conditional Statement  Conditional statements are the set of commands used to perform different actions based on.
Chapter 3. Control Structure C++ Programing. Conditional structure C++ programming language provides following types of decision making statements. Click.
Control Structure  What is control Structure?  Types of Controls  Use the control structure in VBScript.  Example Summery.
Chapter 7 Control Structures. Java has very flexible three looping mechanisms. You can use one of the following three loops:  while Loop  do...while.
Conditional Statements A conditional statement lets us choose which statement will be executed next Conditional statements give us the power to make basic.
Instructor: Alexander Stoytchev CprE 185: Intro to Problem Solving (using C)
Silberschatz and Galvin  C Programming Language Decision making in C Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University.
 Very often when you write code, you want to perform different actions for different decisions. You can use conditional statements in your code to do.
Loops causes program to execute the certain block of code repeatedly until some conditions are satisfied. Suppose you want to execute some code/s 10 times.
 Type Called bool  Bool has only two possible values: True and False.
Decision Making in C.
Loops in Java.
Topics The if Statement The if-else Statement Comparing Strings
Control Structures.
Loop Control Structure.
FLOW OF CONTROL.
Topics The if Statement The if-else Statement Comparing Strings
Lesson 8: Boolean Expressions and "if" Statements
IF if (condition) { Process… }
Control Structures: Selection Statement
Professor Jodi Neely-Ritz CGS3460
CSE 1020:Control Structure
Chapter 8: More on the Repetition Structure
Visual Basic – Decision Statements
Control Structures Part 3
Conditional Statements
SELECTIONS STATEMENTS
Lecture Notes – Week 2 Lecture-2
Conditionals.
Chapter 5: Selection Statement
CS2011 Introduction to Programming I Selections (I)
Program Flow.
Chapter 4: Boolean Expressions, Making Decisions, and Disk Input and Output Prof. Salim Arfaoui.
There many situations comes in real life when we need to make some decisions and based on these decisions, we decide what should we do next. Similar situations.
Decisions, decisions, decisions
Control Structures: Selection Statement
Comparing Data & the ‘switch’ Statement
Comparing Data & the ‘switch’ Statement
Chapter 2 Sets Active Learning Lecture Slides
CSCE 206 Lab Structured Programming in C
Presentation transcript:

Mailid: tejeshbss@gmail.com, neeru8416@gmail.com C-Language Lecture By B.S.S.Tejesh, S.Neeraja Asst.Prof, Open Source Developers Mailid: tejeshbss@gmail.com, neeru8416@gmail.com

Contents Control Statements if if else Nesting of if else else if ladder switch Example programs

if Syntax: Description: if(expression) statement1; Description: In these type of statements, if condition is true, then respective block of code is executed. It Checks whether the given Expression is Boolean or not !! If Expression is True Then it executes the statement otherwise jumps to next_instruction

if demonstration

if else statement Also called as bi-directional selection control statement. Mainly used for taking one of the two possible actions. Description: In these type of statements, group of statements are executed when condition is true.  If condition is false, then else part statements are executed.

Nested if else We can have another if... else statement in the if block or the else block. This is called nesting of if …else statements. If condition 1 is false, then condition 2 is checked and statements are executed if it is true. If condition 2 also gets failure, then else part is executed.

Syntax:

else if ladder This is a type of nesting in which there is an if. .. else statement in every else part except the last else part. This type of nesting is frequently used in programs and is also known as else if ladder.

ex1

ex2

Programs