C Tokens

RiponHossain5 2,336 views 13 slides Jul 28, 2018
Slide 1
Slide 1 of 13
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13

About This Presentation

objectives,Introduction,Type of C tokens etc.presentation slide


Slide Content

Welcome To Our Presentation

Course Code: CSE-121 Course Title: Computer Programming Submitted To : M.Nahid Reza Lecturer, Dept. of EEE Daffodil International University Submitted by: 01.Ripon Hossain ID:172-33-4008 02. Naeem Hasan ID:172-33-4135 03.Md.Shamim Ahosan ID:172-33-4207 Section: B Dept. of EEE (Evening) Daffodil International University Date of Submission: August 16, 2017

C TOKENS Presentation Topic

Introduction to C Tokens Types of C Tokens Keywords Identifiers Constants Strings Special Symbols Operators Objectives

In a Passage of text,indiviual words and punctuation marks are called tokens.similarly in C programming the smallest individual units are known as C tokens. C language has six types of tokens, and programs are written using these tokens, and the syntax of the language. Introduction to C Tokens

C Tokens Keywords Identifiers Constants Strings Special Symbols Operators Types of C Tokens

Keywords serves as the building blocks for a program statements.All keywords have a fixed meaning and cannot be changed. Keywords cannot be used as normal identifier names. Few examples of keywords used in C are listed below. Int b reak goto char s witch void Keywords

Identifier refers to the name of variables,functions and arrays.These are user defined names and consists of a sequence of letters and digits. Both uppercase and lowercase letters can be used,and C language is case sensitive A special symbol underdscore(_) is also permitted. Rules for Identifiers: First character must be an alphabet. Must consist of only letters,digits or underscore. Should not be a keyword should not have any blank space. Example:- int num; char name; Where num and name are identifier names. Identifiers

Constants refers to fixed values that do not change during the execution of a program. Basic types of C constants are shown in the flowchart. constants Numeric constants Character constants Integer constants Real constants Single Character constants String constants Constants

Strings are nothing but array of characters ended with null character (“\0”).This null character indicates the end of the string. Strings are always enclosed by double quotes. Wheras,character is enclosed by single quotes in C. Example:- char name [10]; In this example the variable name can store up to 10 bytes. Strings

The following special symbols are used in C having some special meaning and thus,cannot be used for some other purpose. [ ] ( ) { } , ; : * … = # Braces{}: These opening and ending curly braces marks the start and end of a block of code containing more then one executable statement. Parentheses(): These special symbols are used to indicate function calls and functions parameters. Brackets[]: opening and closing brackets are used as array element reference.these indicate single and multidimensional subscripts. Special Symbols

The symboles which are used to perform logical and mathematical operations in a C program are called C operators. Operators used in C program are Arithmetic operators Assignment operators Relational operators Logical operators Bit Wise operators Conditional operators(ternary operators) Increment/decrement operators Special operators Operators

THANK YOU
Tags