trigraph ??= is for # ??( is for [ ??< is for { ??! is for |

Slides:



Advertisements
Similar presentations
1 Storage Duration and Scope –Local and global variables Storage classes –automatic, static, external, register Todays Material.
Advertisements

Chapter 7: User-Defined Functions II
Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Object Oriented Programming in JAVA
Structure of a C program
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
Overview scope - determines when an identifier can be referenced in a program storage class - determines the period of time during which that identifier.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
Storage Classes.
COMPUTER PROGRAMMING. Data Types “Hello world” program Does it do a useful work? Writing several lines of code. Compiling the program. Executing the program.
18-2 Understand “Scope” of an Identifier Know the Storage Classes of variables and functions Related Chapter: ABC 5.10, 5.11.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer.
JAVA Tokens. Introduction A token is an individual element in a program. More than one token can appear in a single line separated by white spaces.
PASSING VALUE TO A FUNCTION # CALL BY VALUECALL BY VALUE # CALL BY REFERENCECALL BY REFERENCE STORAGE CLASS # AUTOAUTO # EXTERNALEXTERNAL # STATICSTATIC.
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
C++ Character Set It is set of Characters/digits/symbol which is valid in C++. Example – A-Z, (white space) C++ Character Set It is set of.
Fundamentals of C and C++ Programming. EEL 3801 – Lotzi Bölöni Sub-Topics  Basic Program Structure  Variables - Types and Declarations  Basic Program.
CSCI 130 Chapter 3. Variables & Names Variable Declarations: –reserve a storage location in memory –identify the name of the variable –identify the type.
Programming Fundamental Slides1 Data Types, Identifiers, and Expressions Topics to cover here: Data types Variables and Identifiers Arithmetic and Logical.
 Character set is a set of valid characters that a language can recognise.  A character represents any letter, digit or any other sign  Java uses the.
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
Dennis Ritchie 1972 AT & T Bell laboratories (American Telephone and Telegraph) USA 1www.gowreeswar.com.
Procedural Programming Criteria: P2 Task: 1.2 Thomas Jazwinski.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
 2007 Pearson Education, Inc. All rights reserved Random Number Generation  rand function – Load – Returns "random" number between
C++ Programming Lecture 11 Functions – Part III By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department.
ECE 103 Engineering Programming Chapter 36 C Storage Classes Herbert G. Mayer, PSU CS Status 8/4/2014 Initial content copied verbatim from ECE 103 material.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Ajmer Singh PGT(IP) Programming Fundamentals. Ajmer Singh PGT(IP) Java Character Set Character set is a set of valid characters that a language can recognize.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
Tokens in C  Keywords  These are reserved words of the C language. For example int, float, if, else, for, while etc.  Identifiers  An Identifier is.
0 Chap.2. Types, Operators, and Expressions 2.1Variable Names 2.2Data Types and Sizes 2.3Constants 2.4Declarations 2.5Arithmetic Operators 2.6Relational.
Chapter 2. Variable and Data type
 constant represented by a name, just like a variable, but whose value cannot be changed  The const keyword precedes the type, name, and initialization.
Department of Electronic & Electrical Engineering Statements Blocks{} Semicolons ; Variables Names keywords Scope.
JavaScript Variables. Definition A variable is a "container" for information you want to store. A variable's value can change during the script.
Lecture 4 Monday Sept 9, Variables and Data Types ►A►A►A►A variable is simply a name given by the programmer that is used to refer to computer storage.
Numbers in ‘C’ Two general categories: Integers Floats
Course Contents KIIT UNIVERSITY Sr # Major and Detailed Coverage Area
Data types Data types Basic types
C Functions -Continue…-.
BASIC ELEMENTS OF A COMPUTER PROGRAM
LESSON 3 IO, Variables and Operators
C Language VIVA Questions with Answers
Data Types, Identifiers, and Expressions
Storage class in C Topics Automatic variables External variables
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
Variables In programming, we often need to have places to store data. These receptacles are called variables. They are called that because they can change.
Advanced Programming Basics
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
Basics of ‘C’.
C AS A LANGUAGE Interface between computer & human being. ALPHABETS
CS111 Computer Programming
Introduction to C Programming
Local Variables, Global Variables and Variable Scope
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.
Storage class.
Chapter 2: Introduction to C++.
WEEK-2.
In C Programming Language
C Language B. DHIVYA 17PCA140 II MCA.
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
C Programming Lecture-17 Storage Classes
Storage classes in C In C language, each variable has a storage class which decides the following things: scope i.e where the value of the variable would.
Storage Classes.
Getting Started With Coding
Presentation transcript:

trigraph ??= is for # ??( is for [ ??< is for { ??! is for |

tokens Smallest individual unit is token Keyword e.g. float while Identifier e.g. main,amount Constant e.g. 100 String Special symbol e.g [] {} operator

Keyword & identifier,variable Keyword have Fixed meaning Rules for identifier : - first character alphabet - only letters , digit and underscore - only 31 characters - con not use keyword - no white space

constant

Character & string Character : ‘c’ - printf(“%i”,’c’); => will print 99 - printf(“%c”,’99’); => will print c String : “c” Escape sequence : \n, \t

Data types Primary data type: int, float User defined : tyepdef int unit; unit salary; Derived data tyepe : array,function,structure

Data types

operators

Bitwise operator

showbits( )

One’s Complement Operator

Right Shift Operator

Left Shift Operator

Bitwise AND Operator

Bitwise OR Operator

Operator Precedence

C is middle level language Programming efficiency like high level language and Machine efficiency like low level language

Local and global variable Local variable : declared inside block or function and variable is accessible in block only Global variable : declared in program accessible everywhere in program Life time of variables

Local variables Global variables Declared inside function body Scope local to function Not initialized value variable with same in different function is possible Advisable to use Void main() { int i=4; } Declared outside function body Start to end of program Auto initialized to 0 variable with same in different function is NOT possible Creates difficulty in debugging Int i=1; Void main() { //code }

Storage classes Storage class defines scope and life time of variable Storage class decides location of variable : Memory or CPU registers variable’s storage class tells us: - Where the variable would be stored. - What will be the initial value of the variable, if initial value is not specifically assigned.(i.e. the default initial value). - What is the scope of the variable; i.e. in which functions the value of the variable would be available. - What is the life of the variable; i.e. how long would the variable exist.

Automatic Storage Class

Register Storage Class

Static Storage Class Storage : Memory. Default initial value : Zero. Scope : Local to the block in which the variable is defined Life : Value of the variable persists between different function calls.

External Storage Class