C-Language Keywords(C99)

Slides:



Advertisements
Similar presentations
Fundamentals of Computer and programming in C
Advertisements

Chapter 3: Beginning Problem Solving Concepts for the Computer Programming Computer Programming Skills /1436 Department of Computer Science.
Types and Variables. Computer Programming 2 C++ in one page!
Structure of a C program
CS1061 C Programming Lecture 4: Indentifiers and Integers A.O’Riordan, 2004.
Chapter 2 Data Types, Declarations, and Displays
Chapter 2: Introduction to C++.
Computer Science: A Structured Programming Approach Using C1 Objectives ❏ To understand the structure of a C-language program. ❏ To write your first C.
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.
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.
COMPUTER PROGRAMMING. Data Types “Hello world” program Does it do a useful work? Writing several lines of code. Compiling the program. Executing the program.
Syntax of C Programming Language #Lesson 2 Sen Zhang.
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.
Input & Output: Console
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.
Constants in C A Presentation On Department of Computer & Information Technology, M.S.P.V.L. Polytechnic College, Pavoorchatram.
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.
Data & Data Types & Simple Math Operation 1 Data and Data Type Standard I/O Simple Math operation.
 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.
Copyright © 2015, 2012, 2009 Pearson Education, Inc., Publishing as Addison-Wesley All rights reserved. Chapter 2: Introduction to C++
Variables and Data Types.  Variable: Portion of memory for storing a determined value.  Could be numerical, could be character or sequence of characters.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
C++ Basics Tutorial 5 Constants. Topics Covered Literal Constants Defined Constants Declared Constants.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
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.
Gator Engineering 1 Chapter 2 C Fundamentals (Continued) Copyright © 2008 W. W. Norton & Company. All rights reserved.
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.
C++ Basics Programming. COMP104 Lecture 5 / Slide 2 Introduction to C++ l C is a programming language developed in the 1970s with the UNIX operating system.
1 CSC 1111 Introduction to Computing using C++ C++ Basics (Part 1)
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Introduction to C++
2. C FUNDAMENTALS. Example: Printing a Message /* Illustrates comments, strings, and the printf function */ #include int main(void) { printf("To C, or.
Basic Types, Variables, Literals, Constants. What is in a Word? A byte is the basic addressable unit of memory in RAM Typically it is 8 bits (octet)
Java Basics. Tokens: 1.Keywords int test12 = 10, i; int TEst12 = 20; Int keyword is used to declare integer variables All Key words are lower case java.
Introduction C# program is collection of classes Classes are collection of methods and some statements That statements contains tokens C# includes five.
Introduction to C Programming I Subject: T0016 – ALGORITHM AND PROGRAMMING Year: 2013.
1 ENERGY 211 / CME 211 Lecture 3 September 26, 2008.
C++ Lesson 1.
Asst.Prof.Dr. Tayfun ÖZGÜR
Variables, Identifiers, Assignments, Input/Output
Basics (Variables, Assignments, I/O)
Data types Data types Basic types
BASIC ELEMENTS OF A COMPUTER PROGRAM
LESSON 3 IO, Variables and Operators
Wel come.
Chapter 3: Understanding C# Language Fundamentals
CSE101-Lec#3 Components of C Identifiers and Keywords Data types.
Basics (Variables, Assignments, I/O)
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.
2.1 Parts of a C++ Program.
פרטים נוספים בסילבוס של הקורס
Basics of ‘C’.
An overview of Java, Data types and variables
C AS A LANGUAGE Interface between computer & human being. ALPHABETS
Govt. Polytechnic,Dhangar
Variables, Identifiers, Assignments, Input/Output
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.
Prof. Bhushan Trivedi Director GLS Institute of Computer Technology
Variables in C Declaring , Naming, and Using Variables.
Chapter 2: Introduction to C++.
2. Second Step for Learning C++ Programming • Data Type • Char • Float
ECE 103 Engineering Programming Chapter 8 Data Types and Constants
Programming Language C Language.
Chap 2. Identifiers, Keywords, and Types
Module 2 Variables, Data Types and Arithmetic
C Language B. DHIVYA 17PCA140 II MCA.
Variables in C Topics Naming Variables Declaring Variables
Presentation transcript:

C-Language Keywords(C99) Character Set of C-Language Alphabets : A-Z and a-z Digits : 0-9 Special Symbols : ~ ! @ # $ % ^ & ( ) _ - + = | \ { } [ ] : ; “ ‘ < > , . ? / White Spaces : space , Horizontal tab, Vertical tab, New Line Form Feed. C-Language Keywords(C99) auto double int struct break else long switch case enum register typedef char extern return union const float short unsigned continue for signed void default goto sizeof volatile do if static while _Bool _Imaginary restrict _Complex inline

C-Tokens Tokens : The smallest individual units of a C- program are called Tokens. Key words, Identifiers, Constants, Operators, Delimiters. Key words : have a predefined meaning and these meanings cannot be changed. All keywords must be written in small letters (except additional c99 keywords). Identifiers : names of variables, functions, structures, unions, macros, labels, arrays etc., Rules for define identifiers : a) First character must be alphabetic character or under score b) Second character onwards alphabetic character of digit or under score. c) First 63 characters of an identifier are significant. d) Cannot duplicate a key word. e) May not have a space or any other special symbol except under score. f) C – language is Case-sensitive.

C-Tokens Constants : fixed values that do not change during execution of a program. Boolean constants : 0 ( false) and 1 (true) Character constants : only one character enclosed between two single quotes ( except escape characters ). wide character type - wchar_t - for Unicode characters. Integer constants : +123, -3454 , 0235 (octal value), 0x43d98 ( hexa - decimal value) 54764U, 124356578L, 124567856UL Float constants : 0.2 , 876.345, .345623 , 23.4E+8, 47.45e+6 String Constants : “Hello world” , “Have a nice day!” Complex Constants : real part + imaginary part * I ex : 12.3 + 3.45 * I Operators : a symbol, which indicates an operation to be performed. Operators are used to manipulate data in program. Delimiters : Language Pattern of c-language uses special kind of symbols : (colon, used for labels) ; (semicolon terminates statement ) ( ) parameter list [ ] ( array declaration and subscript ), { } ( block statement ) # ( hash for preprocessor directive ) , (comma variable separator )

Data Types ( pre defined ) Type Typical Size in Bits Minimal Range char 8 –127 to 127 unsigned char 8 0 to 255 signed char 8 –127 to 127 int 16 or 32 –32,767 to 32,767 unsigned int 16 or 32 0 to 65,535 signed int 16 or 32 Same as int short int 16 –32,767 to 32,767 unsigned short int 16 0 to 65,535 signed short int 16 Same as short int long int 32 –2,147,483,647 to 2,147,483,647 long long int 64 –(263) to 263 – 1 (Added by C99) signed long int 32 Same as long int unsigned long int 32 0 to 4,294,967,295 unsigned long long int 64 264 – 1 (Added by C99) float 32 3.4e-38 to 3.4e+38 double 64 1.7e-308 to 1.7e+308 long double 80 3.4e-4932 to 1.1e+4932 void -- data type that not return any value

ASCII

Conversion Specifiers Code Format %a Hexa decimal output in the form of 0xh.hhhhp+d(C99 only) %s String of characters (until null zero is reached ) %c Character %d Decimal integer %f Floating-point numbers %e Exponential notation floating-point numbers %g Use the shorter of %f or %e %u Unsigned integer %o Octal integer %x Hexadecimal integer %i Signed decimal integer %p Display a pointer %n The associated argument must be a pointer to integer, This sepecifier causes the number of characters written in to be stored in that integer. %hd short integer %ld long integer %lf long double %% Prints a percent sign (%)

Back Slash ( Escape Sequence) Characters Code Meaning \b Backspace \f Form feed \n New line \r Carriage return \t Horizontal tab \" Double quote \' Single quote \ \ Backslash \v Vertical tab \a Alert \? Question mark \N Octal constant (N is an octal constant) \xN Hexadecimal constant (N is a hexadecimal constant)