INTRODUCTION TO C LANGUAGE

Slides:



Advertisements
Similar presentations
1 C++ Syntax and Semantics The Development Process.
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.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie June 27, 2005.
JavaScript, Fourth Edition
JavaScript, Third Edition
1 Lecture 3  Lexical elements  Some operators:  /, %, =, +=, ++, --  precedence and associativity  #define  Readings: Chapter 2 Section 1 to 10.
Introduction to C language
Copyrights© 2008 BVU Amplify DITM Software Engineering & Case Tools Page:1 INTRODUCTION TO ‘C’ LANGUAGE Chapter 2.
C Tokens Identifiers Keywords Constants Operators Special symbols.
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.
1 CSC103: Introduction to Computer and Programming Lecture No 6.
Structured Programming Approach Module III - Expressing Algorithm Sequence Module IV - Concept of scalar Data Types Prof: Muhammed Salman Shamsi.
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++
Constants Numeric Constants Integer Constants Floating Point Constants Character Constants Expressions Arithmetic Operators Assignment Operators Relational.
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.
CONSTANTS Constants are also known as literals in C. Constants are quantities whose values do not change during program execution. There are two types.
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 Types Declarations Expressions Data storage C++ Basics.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Constants, Variables and Data types in C The C character Set A character denotes any alphabet, digit or special symbol used to represent information.
Types of C Variables:  The following are some types of C variables on the basis of constants values it has. For example: ○ An integer variable can hold.
Topics to be covered  Introduction to C Introduction to C  Characterstics of C Characterstics of C  Characterset Characterset  Keywords Keywords 
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.
Values, Types, and Variables. Values Data Information Numbers Text Pretty much anything.
C BASICS QUIZ (DATA TYPES & OPERATORS). C language has been developed by (1) Ken Thompson (2) Dennis Ritchie (3) Peter Norton (4) Martin Richards.
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.
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.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Constants, Data Types and Variables
Course Contents KIIT UNIVERSITY Sr # Major and Detailed Coverage Area
Introduction to ‘c’ language
Chapter 2 Variables.
The Machine Model Memory
Data types Data types Basic types
BASIC ELEMENTS OF A COMPUTER PROGRAM
Wel come.
ITEC113 Algorithms and Programming Techniques
C Language VIVA Questions with Answers
' C ' PROGRAMMING SRM-MCA.
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
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.
Visit for more Learning Resources
Tejalal Choudhary “Computer Programming” Fundamentals of “C”
Computer Programming LAB 1 Tejalal Choudhary Asst. Prof, CSE Dept.
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.
Character Set The character set of C represents alphabet, digit or any symbol used to represent information. Types Character Set Uppercase Alphabets A,
C++ Basics.
Basics of ‘C’.
Lesson 7-1 Multiplying Monomials
C AS A LANGUAGE Interface between computer & human being. ALPHABETS
CS111 Computer Programming
Chapter 2 Variables.
C++ Data Types Data Type
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.
Expressions and Assignment
Chapter 2: Introduction to C++.
Chapter 2 Variables.
DATA TYPES AND OPERATIONS
Course Outcomes of Programming In C (PIC) (17212, C203):
Basic Programming Lab C.
Variables and Constants
Programming Fundamental-1
Divide two Integers.
Presentation transcript:

INTRODUCTION C LANGUAGE INTRODUCTION = computing, C (/ ˈ si ː /, as in the letter C) is a general- purpose programming language initially developed by Dennis Ritchie between 1969 and 1973 at AT&T Bell Labs. Like most imperative languages in the ALGOL tradition, C has facilities for structured programcomputing/ ˈ si ː /the letter Cprogramming languageDennis RitchieAT&T Bell Labsimperative languagesALGOLstructured program 1) C is structured programming language. 2) C used extension.c 3) C is high level programming language.

CONSTANTS,VARIABLES AND KEYWORDS Types of C Constants C constants can be divided into two major categories: Primary Constants Secondary Constants

PRIMARY CONSTANTS Integer constant Real constant Character constant

SECONDARY CONSTANTS Array Pointer Structure Union Enum etc.

Rules for Constructing Integer Constants An integer constant must have at least one digit. It must not have a decimal point. It can be either positive or negative. If no sign precedes an integer constant it is assumed to be positive. No commas or blanks are allowed within an integer constant. The allowable range for integer constants is to , but range also depends on compiler.

Example Ex. :

RULES FOR CONSTRUCTING REAL CONSTANTS Real constants are often called Floating Point constants. The real constants could be written in two forms—Fractional form and Exponential form. Following rules must be observed while constructing real constants expressed in fractional form: A real constant must have at least one digit. It must have a decimal point. It could be either positive or negative. Default sign is positive. No commas or blanks are allowed within a real constant.

Example Ex.:

Rules for Constructing Character Constants A character constant is a single alphabet, a single digit or a single special symbol enclosed within single inverted commas. Both the inverted commas should point to the left. For example, ’A’ is a valid character constant whereas ‘A’ is not. The maximum length of a character constant can be 1 character.

Example Ex.: 'A' 'I' '5' '='

VARIABLES Rules for Constructing Variable Names (A variable name is any combination of 1 to 31 alphabets, digits or underscores. Some compilers allow variable names whose length could be up to 247 characters The first character in the variable name must be an alphabet or underscore. No commas or blanks are allowed within a variable name. No special symbol other than an underscore (as in gross_sal) can be used in a variable name. Ex.: si_int m_hra pop_e_89

KEYWORDS Keywords are the words whose meaning has already been explained to the C compiler (or in a broad sense to the computer). The keywords cannot be used as variable names because if we do so we are trying to assign a new meaning to the keyword, which is not allowed by the computer.

There are only 32 keywords available in C.