C syntax (simplified) BNF. Program ::= [ ] Directives ::= [ ] ::= | |… ::=#include > ::=#define.

Slides:



Advertisements
Similar presentations
Java Control Statements
Advertisements

Control Structures.
Control Statements. Define the way of flow in which the program statements should take place. Control Statements Implement decisions and repetitions.
Control Flow Statements: Repetition/Looping
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Making Choices in C if/else statement logical operators break and continue statements switch statement the conditional operator.
True or false A variable of type char can hold the value 301. ( F )
COMP1180 Review Date: 4 March, 2009 Time: 10:30am - 12:20pm Venue: –CS students -- FSC801C and FSC801D –IS and other students -- OEE1017 Remarks: – 1)
Switch Switch case statements are a substitute for long if statements that compare a variable to several "integral" values ("integral" values are simply.
C Programming Basics Lecture 5 Engineering H192 Winter 2005 Lecture 05
Programming Switch command. COMP102 Prog. Fundamentals: Switch command / Slide 2 Multiple Selection: The switch Statement value1 action 1 value2 action.
Switch Statements Comparing Exact Values. 2 The Switch Statement The switch statement provides another way to decide which statement to execute next The.
Introduction to C Language
CP104 Introduction to Programming Selection Structures_3 Lecture 11 __ 1 The Switch Statement The switch statement provides another means to select one.
Selection Statements in C++ If Statement in C++ Semantics: These statements have the same meaning as in the algorithmic language. 2- Two way selection:
M. Taimoor Khan #include void main() { //This is my first C++ Program /* This program will display a string message on.
Practice 1 Seoul National University Graphics & Media Lab.
5-1 Repetition Statements Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional statements,
CompSci 100E 2.1 Java Basics - Expressions  Literals  A literal is a constant value also called a self-defining term  Possibilities: o Object: null,
Chapter 3. Outline Relational Operators Loops Decisions Logical Operators Precedence Summary.
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Chapter 05 (Part III) Control Statements: Part II.
Switch Statements Comparing Exact Values. The Switch Statement: Syntax The switch statement provides another way to decide which statement to execute.
Engineering H192 - Computer Programming The Ohio State University Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics.
Chapters 1-5 Review C++ Class. Chapter 1 – the big picture Objects Class Inheritance Reusability Polymorphism and Overloading.
Engineering H192 - Computer Programming Gateway Engineering Education Coalition Lect 5P. 1Winter Quarter C Programming Basics Lecture 5.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Decisions. Three Forms of Decision Making in Java if statements (test a boolean expression) switch statements (test an integer expression) conditional.
Control statements Mostafa Abdallah
LESSON 4 Decision Control Structure. Decision Control Structures 1. if statement 2. if-else statement 3. If-else-if statement 4. nested if statement 5.
A Introduction to Computing II Lecture 1: Java Review Fall Session 2000.
Session 2 Operators, Decisions and Loops. Objectives Operators Casting data Decision marking structures Loops break, continue, return.
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Chad’s C++ Tutorial Demo Outline. 1. What is C++? C++ is an object-oriented programming (OOP) language that is viewed by many as the best language for.
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.
Presentation By :- Nikhil R. Anande ( ) Electronic & Communication Engineering. 3 nd Year / 5 th Semester FACULTY GUIDE : RAHIUL PATEL SIR MICROCONTROLLER.
More on conditional statements. Conditionals In some situations the typical if-else statements may become cumbersome Depending on the situation, there.
Control Statements in C
ECE Application Programming
BASIC ELEMENTS OF A COMPUTER PROGRAM
Unit-1 Introduction to Java
LESSON 4 Decision Control Structure
LESSON 3 IO, Variables and Operators
Test Review Computer Science History
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
Programming Fundamentals
الكلية الجامعية للعلوم التطبيقية
Introduction to Programming
null, true, and false are also reserved.
Conditional Statements
Variables, Loops, Decision Statements, etc
Variables in C Topics Naming Variables Declaring Variables
Review for Final Exam.
Govt. Polytechnic,Dhangar
Introduction C is a general-purpose, high-level language that was originally developed by Dennis M. Ritchie to develop the UNIX operating system at Bell.
Variables in C Declaring , Naming, and Using Variables.
Review for Final Exam.
2. Second Step for Learning C++ Programming • Data Type • Char • Float
Program Flow.
Programming Language C Language.
Nate Brunelle Today: Conditional Decision Statements
Fundamental Programming
Welcome back to Software Development!
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Seoul National University
Problem 1 Given n, calculate 2n
Variables in C Topics Naming Variables Declaring Variables
Control Structure គោលបំណងនៃមេរៀន អ្វីជា Control structure ?
Presentation transcript:

C syntax (simplified) BNF

Program ::= [ ]

Directives ::= [ ] ::= | |… ::=#include > ::=#define

Functions ::= [ ] ::= ::= ::=

Functions ::= ([ ]) ::= [, ] ::= |

Statements ::= [ ] ::= ; | ::= |return |break |continue |goto

Statements ::= { [declarations][ ] }

Declarations ::= [ ] ::= ; | ; ::= [= ]>[, ] ::= = [ ] ::= [ ] [[ ]…][={,…}]

Data types ::= [unsigned] [short|long] int | char | float | double

Identifiers ::= [ ] ::=_|A|B|…|z = [ ] = |

Expressions ::= | |& |…

Expressions |( ) | | | | ::= ? :

Arithmetic expressions ::= | ::=+|- ::=+|-|*|/|%

Relational Expression ::= ::= | =|==|!= ::= ! | && | ||

Assignments ::= ::= | [ ]… ::= =|+=|-=|*=|/=|%=

Increment/Decrement ::= | ::=++ ::= | ::=--

Decision Statements ::= | ::= if ( ) [else ]

Switch statement ::= switch ( ) { case : … [default: statements] }

Loop statements ::= while ( ) |do while (expression) |for ( ; ; )

Function calls ::= ::= ([ ]) :: = [, ]

Constants ::= | ::=[-]digits[.digits] ::= [ ] ::=0|1|…|9 ::=“ ” ::= ::=A|B|…|z|0|…|9|(|)|!| |.|*|…