Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 

Slides:



Advertisements
Similar presentations
Chapter 3 – Fundamental Statements
Advertisements

C Programming Language 4 Developed in 1972 by Dennis Ritchie at AT&T Bell Laboratories 4 Used to rewrite the UNIX operating system 4 Widely used on UNIX.
Chapter 9 Formatted Input/Output Acknowledgment The notes are adapted from those provided by Deitel & Associates, Inc. and Pearson Education Inc.
Data types and variables
Overview of C++ Chapter 2 in both books programs from books keycode for lab: get Program 1 from web test files.
CS150 Introduction to Computer Science 1
Chapter 2 Data Types, Declarations, and Displays
JavaScript, Third Edition
1 Lecture 3  Lexical elements  Some operators:  /, %, =, +=, ++, --  precedence and associativity  #define  Readings: Chapter 2 Section 1 to 10.
Chapter 3: Introduction to C Programming Language C development environment A simple program example Characters and tokens Structure of a C program –comment.
Basic Elements of C++ Chapter 2.
Variable & Constants. A variable is a name given to a storage area that our programs can manipulate. Each variable in C has a specific type, which determines.
Objectives You should be able to describe: Data Types
Chapter 2 Getting Started in C Programming
A First Book of ANSI C Fourth Edition
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Chapter 2: C Fundamentals Dr. Ameer Ali. Overview C Character set Identifiers and Keywords Data Types Constants Variables and Arrays Declarations Expressions.
1 Workshop Topics - Outline Workshop 1 - Introduction Workshop 2 - module instantiation Workshop 3 - Lexical conventions Workshop 4 - Value Logic System.
A Variable is symbolic name that can be given different values. Variables are stored in particular places in the computer ‘s memory. When a variable is.
2440: 211 Interactive Web Programming Expressions & Operators.
System development with Java Lecture 2. Rina Errors A program can have three types of errors: Syntax and semantic errors – called.
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
Constants in C A Presentation On Department of Computer & Information Technology, M.S.P.V.L. Polytechnic College, Pavoorchatram.
Five Tips to Success. Work hard Try more exercises and more practice.
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Input, Output, and Processing
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.
CPS120: Introduction to Computer Science
Lecture #5 Introduction to C++
Characters and tokens Characters are the basic building blocks in C program, equivalent to ‘letters’ in English language Includes every printable character.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
CNG 140 C Programming Prof. Muslim Bozyiğit Dr. Ghalib A. Shah Department of Computer Engineering Mıddle East Technical University, NCC Spring
BASICS CONCEPTS OF ‘C’.  C Character Set C Character Set  Tokens in C Tokens in C  Constants Constants  Variables Variables  Global Variables Global.
What is C? C is a programming language. It was developed in 1972 USA. It was designed and written by a man named dennis ritchie. C is the base for all.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
A first program 1. #include 2. using namespace std; 3. int main() { 4. cout
Chapter 3 – Variables and Arithmetic Operations. Variable Rules u Must declare all variable names –List name and type u Keep length to 31 characters –Older.
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.
Copyright © – Curt Hill Types What they do.
C++ Basics Tutorial 5 Constants. Topics Covered Literal Constants Defined Constants Declared Constants.
Constants, Variables and Data types in C The C character Set A character denotes any alphabet, digit or special symbol used to represent information.
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.
Chapter2 Constants, Variables, and Data Types. 2.1 Introduction In this chapter, we will discuss –constants (integer, real, character, string, enum),symbolic.
1 09/03/04CS150 Introduction to Computer Science 1 What Data Do We Have.
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
Types Chapter 2. C++ An Introduction to Computing, 3rd ed. 2 Objectives Observe types provided by C++ Literals of these types Explain syntax rules for.
INTRODUCTION TO ‘C’ PROGRAMMING BY Prof. P. PADMANABHAM M.Tech (AE), M.Tech(CS), Ph.D(CS)-FIETE, FIE Director Academics, Bharat Institute Of Engineering.
MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.
Introduction C# program is collection of classes Classes are collection of methods and some statements That statements contains tokens C# includes five.
BIL 104E Introduction to Scientific and Engineering Computing Lecture 2.
Constants, Data Types and Variables
Basics of ‘ C ’ By Gaikwad Varsha P. Asst. Prof. Information Technology Dept. Govt. College of Engg. Aurangabad.
INTRODUCTION TO C LANGUAGE
Introduction to ‘c’ language
Chapter Topics The Basics of a C++ Program Data Types
BASIC ELEMENTS OF A COMPUTER PROGRAM
Wel come.
C Language VIVA Questions with Answers
' C ' PROGRAMMING SRM-MCA.
INTRODUCTION c is a general purpose language which is very closely associated with UNIX for which it was developed in Bell Laboratories. Most of the programs.
C++ Basics.
C++ fundamentals Lecture 1, Chapter 2 – pp /22/2018 Y K Choi.
Basics of ‘C’.
C AS A LANGUAGE Interface between computer & human being. ALPHABETS
C++ Data Types Data Type
Lexical Elements & Operators
C Programming Lecture-3 Keywords, Datatypes, Constants & Variables
Basic Programming Lab C.
Presentation transcript:

Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords  Constants Constants  Types of constants Types of constants  Symbolic Constants Symbolic Constants

Introduction to C C is a general purpose programming language. It was developed at AT & T’s Bell Laboratories of USA IN It was developed by Dennis Ritchie. Back

Characteristics of C 1. It is reliable, simple and easy to use. 2. There are only 32 Keywords in C. 3. It helps to develop structured programs. 4. C is highly portable. 5. User can add their own functions to the C library. 6. C is a format free language. 7. It is suitable for Graphics programming. 8. Pointer Implementation is available. Back

Character Set A character consist of any letter or alphabet, digit or special symbol. LettersUppercase A-Z Lowercase a-z Digits All Decimal Digits 0-9 Special Symbols + - * / # ? _ ‘ ;, : “ { } [ ] ( ) White Spaces, Blank Space, Tab Back

Keywords Keywords have their predefined meaning. They cannot be redefined by the programmers. They are also known as Reserved Keywords.

There are 32 Keywords in C: AutoDoubleintstruct Breakelselongswitch Case enumregistertypedef Charexternreturnunion Constfloatshortunsigned Continueforsignedvoid Default gotosizeofvolatile Doifstaticwhile Back

Constants Constant that remains unchanged during the execution of the program. Back Constants Numeric Constants Character Constatns Integer Constants Real Constants Single Character Constants String Constants

Types of constants Numeric Constants 1. Integer Constant: It is a sequence of digits without decimal point. Rules are: 1) It must have at least one digit. 2) It contains neither a decimal point nor an exponent. 3) Commas and blank spaces is not allowed. 4) Sign (+ or -) must precede the number. 5) Default sign is positive. 6) Allowed range is to 32767

There are three types of integer constants: 1) Decimal integers consists of a set of digits 0 to 9. Examples: 18,-11,+39,0 2) Octal integer constants consists of a set of digits 0 to 7 with a leading 0 Examples: 015,0375,0 3) Hexadecimal integer constant consist f a set of digits 0 to 9 or alphabets A(a) to F(f) with a leading 0x or 0X. Examples: Ox5,ox7d,0x79

2) Real Constants(Floating Point Constants): It is a number that contains either a decimal point or an exponent or both. Examples: 95.1,B0.012, 2.2e-5,11e+3, 2.3e-3 Forms of real constants are A) Fractional form real constants: Rules are: 1. A real constant must have atleast one digit. 2. It must contain a decimal point. 3. Commas and blank spaces is not allowed. 4. Sign (+ or -) must precede the number. 5. Default sign is positive. 6. It could be either positive or negative.

B) Exponential form real constants: Mantissa e exponent 1)The mantissa is either a real number expressed in decimal or an integer. 2) The exponent is always an integer number with an optional plus or minus sign. 3) The mantissa part may have a + or – sign. Default sign is +ve. 4) The mantissa part and the exponential part should be separated by a letter ‘e’. 5) Commas and blank spaces is not allowed. 6) Allowed range is -3.4e-38 to 3.4e38

Character Constants 3) Single Character Constant: A single character constant is a single character enclosed in single quotes. The character may be a letter, number or special character. Examples: ‘3’,’A’,’c’,”:” 4) String Constants: A string constant is a sequence of characters enclosed in double quotes. Examples: ‘B.SC.’,’1+3+4’,’V’,”HELLO”

Backslash character constants \nnewline character \ttab \’a single quote \” a double quote Back

Symbolic Constants Format for defining for symbolic constants is Syntax:#define symbolicname constantvalue Example:#define pi This statement must not end with a semicolon and #define is known as preprocessor. Back

Thanks