MAHENDRAN. Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming.

Slides:



Advertisements
Similar presentations
1 C++ Syntax and Semantics The Development Process.
Advertisements

Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Lecture 2 Introduction to C Programming
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Introduction to C Programming CE Lecture 1 Introduction to C.
Structure of a C program
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.
Three types of computer languages
1 Key Concepts:  Why C?  Life Cycle Of a C program,  What is a computer program?  A program statement?  Basic parts of a C program,  Printf() function?
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Data Types.
C programming Language and Data Structure For DIT Students.
Introduction to C language
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.
Copyrights© 2008 BVU Amplify DITM Software Engineering & Case Tools Page:1 INTRODUCTION TO ‘C’ LANGUAGE Chapter 2.
COMPUTER SCIENCE I C++ INTRODUCTION
Basics of “C” Programming
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.
Chapter 2 : Overview of C By Suraya Alias. /*The classic HelloWorld */ #include int main(void) { printf(“Hello World!!"); return 0; }
Chapter 2 Overview of C Part I J. H. Wang ( 王正豪 ), Ph. D. Assistant Professor Dept. Computer Science and Information Engineering National Taipei University.
Five Tips to Success. Work hard Try more exercises and more practice.
Sales person receive RM200/week plus 9% of their gross sales for that week. Write an algorithms to calculate the sales person’s earning from the input.
Instructor - C. BoyleFall Semester
/* Documentations */ Pre process / Linking statements Global declarations; main( ) { Local Declarations; Program statements / Executable statements; }
Sharda University P. K. Mishra (Asst.Prof) Department of Computer Science & Technology Subject Name: Programming Using C Sub Code: CSE-106 Programming.
Lecture #5 Introduction to C++
Week 1 Algorithmization and Programming Languages.
Course Title: Object Oriented Programming with C++ instructor ADEEL ANJUM Chapter No: 03 Conditional statement 1 BY ADEEL ANJUM (MSc-cs, CCNA,WEB DEVELOPER)
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.
C programming language was developed in the seventies by a group of at the Bell Telephone lab. The C language was the outline of two earlier languages.
VARIABLES, CONSTANTS, OPERATORS ANS EXPRESSION
CSCI 3133 Programming with C Instructor: Bindra Shrestha University of Houston – Clear Lake.
Constants, Variables and Data types in C The C character Set A character denotes any alphabet, digit or special symbol used to represent information.
Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 
S CCS 200: I NTRODUCTION AND G ETTING S TART IN C P ROGRAMMING Lect. Napat Amphaiphan.
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
Silberschatz and Galvin  C Programming Language Kingdom of Saudi Arabia Ministry of Higher Education Al-Majma’ah University College of Education.
An overview of C Language. Overview of C C language is a general purpose and structured programming language developed by 'Dennis Ritchie' at AT &T's.
1 Types of Programming Language (1) Three types of programming languages 1.Machine languages Strings of numbers giving machine specific instructions Example:
BASIC C PROGRAMMING LANGUAGE TUTORIAL infobizzs.com.
Java Programming Fifth Edition Chapter 1 Creating Your First Java Classes.
BIL 104E Introduction to Scientific and Engineering Computing Lecture 1.
INTRODUCTION TO C LANGUAGE
Numbers in ‘C’ Two general categories: Integers Floats
Introduction to ‘c’ language
Chapter 1.2 Introduction to C++ Programming
Chapter Topics The Basics of a C++ Program Data Types
Chapter 1.2 Introduction to C++ Programming
Chapter 1.2 Introduction to C++ Programming
BASIC ELEMENTS OF A COMPUTER PROGRAM
Basic Elements of C++.
C Language VIVA Questions with Answers
History of ‘C’ Root of the morden language is ALGOL It’s first
Revision Lecture
Introduction to C++.
BY GAWARE S.R. COMPUTER SCI. DEPARTMENT
' C ' PROGRAMMING SRM-MCA.
Basic Elements of C++ Chapter 2.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
2.1 Parts of a C++ Program.
Introduction to C++ Programming
C programming Language
WEEK-2.
The C Language: Intro.
C – Programming Language
C Language B. DHIVYA 17PCA140 II MCA.
Basic Programming Lab C.
Introduction to C Programming
Presentation transcript:

MAHENDRAN

Session Objectives Session Objectives  Discuss the Origin of C  Features of C  Characteristics of C  Current Uses of C  “C” Programming Structure  Character Set

“C” is a Middle Level language

“C” is a Structure & Procedure Oriented Programming language developed by Dennis Ritchie at AT&T Bell Laboratories in USA in the Year 1972 ( B asic C ombined P rogramming L anguage)

Features of “C” Language  Economy of Expressions  Modern Control Flow and Structures  Rich Set of Operators  It is Well suited for writing both System Software like Operating Systems, Interpreters, Editors and Assembly Programs

UNIX Operating System was Developed by Using “C” Language Developing database Systems Graphics Packages Spread Sheets Word Processors Office automation Scientific/Engineering Applications CAD/CAM Applications

Preprocessor Directives (Incl. headerFile) Global Variable Declarations; void main() { Local Variable Declarations; Input/Output Statements; } Note : Every “C” Statements should end with Semicolon(;)

The C Program Structure

 Preprocessor directives are the instructions given to the compiler.  They are not translated into machine language, but are operated upon directly by the compiler before the compiling process begins.  Preprocessor directives begin with a # (hash)  Preprocessor directives are often placed in the beginning of a program before the main() is declared.

A lot of library functions are subdivided into number of groups. This groups are called Header files Syntax :#include Examples:#include Stdio -> Standard Input/Output Conio -> Console Input/Output Void -> Keyword. It Means Returns Nothing. main() -> It is a function name which can be used to indicate the beginning of the program execution

C has 32 keywords. These keywords combined with a formal syntax form a C programming language. Rules to be followed for all programs written in C All keywords are lowercased C is case sensitive, do while is different from DO WHILE Keywords cannot be used as a variable or function name

Alphabets, Digits,Special Characters Constants, variables & Data Types Keywords Instructions Programs

A Character denotes an alphabet, digit or a special character. These characters can be combined to form variables. Lowercase Letters –a,b,c…… z Uppercase Letters -A,B,C….. Z Digits – 0,1,2,3,…7,8,9 + Plus Sign - Minus Sign, Comma * Asterisk / Slash = Equal At Symbol < Less Than : Colon ; Semicolon

‘A’ ‘*’ “A” “MS”

Escape Sequence Escape sequences are specified as the first argument in Output Statement. They are always preceded with a backslash

Variables are named locations in memory that are used to hold a value that may be modified by the program. The syntax for declaring a variable is Data type Variablename; Valid Examples : CSCavg_valm1 Chennai Anumark_1 Some erroneous identifier names are -1stsst oh!god start….end

RULES for framing a variable : The first character in the Variable name must be an alphabet Alphabets can be followed by a number of digits or underscores No commas or Blank spaces are allowed within a variable name No Special character other than Underscore(_) can be used in a variable name. The variable name should not be a keyword Variable names are case sensitive It should not be of length more than 31 characters

Character Integer Float Double structure Union Pointer enum

1. Type Definition Example:Typedef int age; age male,female 2.Enumerated Datatype Example : enum mon{jan,feb,mar,apr,may,jun,jul,aug,sep,oct,nov,dec };

Session Summary  All variables must be declared in the program before all executable statement  Comments statements may or may not be present in a program  Comment statement improves the readability of a program  A program will always begin by executing the main() function  Every C program must contain atleast one function which must be a main()

EXERCISES 1.Why it is required to include header files your C program? 2. What is #include statement? Indicate its use? 3.Why is the main() function is so special 4. Write a program to calculate Simple and Compound Interest? 5.State the use of comment symbol in a program? 6. Describe the types of constants? Give example?