SlideShare a Scribd company logo
1 of 15
C –Imp Points
K.Taruni
The C Character Set
Alphabets

A, B, ….., Y, Z
a, b, ……, y, z

Digits

0, 1, 2, 3, 4, 5, 6, 7, 8, 9

Special symbols

~‘!@#%^&*()_-+=|{}
[]:;"'<>,.?/

 The alphabets, numbers and special symbols when properly combined form constants, variables
and keywords.
 A constant is an entity that doesn‟t change whereas a variable is an entity that may change.
C stores values at memory locations which are
given a particular name.

x

3

x

5

 Since the location whose name is x can hold different values at different times x is
known as a variable. As against this, 3 or 5 do not change, hence are known as 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.
Following rules must be observed while constructing real
constants expressed in exponential form:





The mantissa part and the exponential part should be separated by a letter e.
The mantissa part may have a positive or negative sign.
Default sign of mantissa part is positive.
The exponent must have at least one digit, which must be a positive or negative integer. Default sign is
positive.

 Range of real constants expressed in exponential form is -3.4e38 to 3.4e38.
 Ex.: +3.2e-5
4.1e8
-0.2e+3

-3.2e-5
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. Still, it would be safer to stick to the rule of 31 characters. Do not
create unnecessarily long variable names as it adds to your typing effort.
 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.
C Keywords-cannot be used as variable names
 The keywords are also called „Reserved words‟.
 There are only 32 keywords available in C.
 Note that compiler vendors (like Microsoft,
Borland, etc.) provide their own keywords apart
from the ones mentioned above. These include
extended keywords like near, far, asm, etc.
 Though it has been suggested by the ANSI
committee that every such compiler specific
keyword should be preceded by two
underscores (as in __asm ), not every vendor
follows this rule.
C Program
 C has no specific rules for the position at which a statement is to be written. That‟s why it






is often called a free-form language.
Every C statement must end with a ;. Thus ; acts as a statement terminator.
The statements in a program must appear in the same order in which we wish them to be
executed; unless of course the logic of the problem demands a deliberate „jump‟ or
transfer of control to a statement, which is out of sequence.
Blank spaces may be inserted between two words to improve the readability of the
statement. However, no blank spaces are allowed within a variable, constant or keyword.
All statements are entered in small case letters.
/* Calculation of simple interest */
/* Author gekay Date: 25/05/2004 */

C Program

main( )
{
int p, n ;
float r, si ;
p = 1000 ;
n=3;
r = 8.5 ;
/* formula for simple interest */

 Comments cannot be nested. For example,
/* Cal of SI /* Author sam date 01/01/2002
*/ */

is invalid.

 −A comment can be split over more than
one line, as in,

 /* This is

si = p * n * r / 100 ;

a jazzy

printf ( "%f" , si ) ;

comment */

}
/* Just for fun. Author: Bozo */

main( )
{
int num ;
printf ( "Enter a number" ) ;

 Type declaration instruction −

To declare the
type of variables used in a C program.

scanf ( "%d", &num ) ;

 Arithmetic instruction −
printf ( "Now I am letting you on a secret..." ) ;
printf ( "You have just entered the number %d",
num ) ;
}

To perform
arithmetic operations between constants and
variables.

 Control instruction − To control the sequence
of execution of various statements in a C
program.
Type declarations.
 float a = 1.5, b = a + 3.1 ;
is alright, but
 float b = a + 3.1, a = 1.5 ;
is not because we are trying to
use a before it is even declared.

 The following statements would work
 int a, b, c, d ;
a = b = c = 10 ;
 However, the following statement would
not work
int a = b = c = d = 10 ;
 Once again we are trying to use b (to
assign to a) before defining it.
Arithmetic Operations
Ex.: int ad ;
float kot, deta, alpha, beta, gamma ;
ad = 3200 ;
kot = 0.0056 ;
deta = alpha * beta / gamma + 3.2 * 2 /
5;

Here,
*, /, -, + are the arithmetic operators.
= is the assignment operator.
2, 5 and 3200 are integer constants.
3.2 and 0.0056 are real constants.
ad is an integer variable.
kot, deta, alpha, beta, gamma are real
variables.
Arithmetic Statement – 3 types
Integer mode arithmetic statement This is an arithmetic statement in which
all operands are either integer variables
or integer constants.
Ex.: int i, king, issac, noteit ;
i=i+1;
king = issac * 234 + noteit - 7689 ;

Real mode arithmetic statement - This is
an arithmetic statement in which all
operands are either real constants or real
variables. Ex.: float qbee, antink, si,
prin, anoy, roi ;
qbee = antink + 23.123 / 4.5 * 0.3442 ;
si = prin * anoy * roi / 100.0 ;

 Mixed mode arithmetic statement - This is an arithmetic statement in which
some of the operands are integers and some of the operands are real.
Arithmetic Instructions
Ex.: float si, prin, anoy, roi, avg ;
int a, b, c, num ;
si = prin * anoy * roi / 100.0 ;
avg = ( a + b + c + num ) / 4 ;

 An arithmetic instruction is often used for
storing character constants in character
variables.

char a, b, d ;
a = 'F' ;
b = 'G' ;
d = '+' ;

 C allows only one variable on left-hand side
of =. That is, z = k * l is legal, whereas k * l =
z is illegal.

 In addition to the division operator C also
provides a modular division operator. This
operator returns the remainder on dividing
one integer with another. Thus the expression
10 / 2 yields 5, whereas, 10 % 2 yields 0.
Note that the modulus operator (%) cannot be
applied on a float. Also note that on using %
the sign of the remainder is always same as
the sign of the numerator. Thus –5 % 2 yields
–1, whereas, 5 % -2 yields 1.
Invalid Statements





a = 3 ** 2 ;
b=3^2;
a = c.d.b(xy) usual arithmetic statement
b = c * d * b * ( x * y ) C statement

#include <math.h>
main( )
{
int a ;
a = pow ( 3, 2 ) ;
printf ( “%d”, a ) ;
}

More Related Content

What's hot

Conversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochConversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochSarmad Baloch
 
Unit 2 c programming_basics
Unit 2 c programming_basicsUnit 2 c programming_basics
Unit 2 c programming_basicskirthika jeyenth
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data typesPratik Devmurari
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C ProgrammingQazi Shahzad Ali
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of CSuchit Patel
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMRc Os
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c languageRai University
 
Problem solving with algorithm and data structure
Problem solving with algorithm and data structureProblem solving with algorithm and data structure
Problem solving with algorithm and data structureRabia Tariq
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfSowmyaJyothi3
 

What's hot (19)

CHAPTER 2
CHAPTER 2CHAPTER 2
CHAPTER 2
 
Conversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad balochConversion of in fix pre fix,infix by sarmad baloch
Conversion of in fix pre fix,infix by sarmad baloch
 
Unit 2 c programming_basics
Unit 2 c programming_basicsUnit 2 c programming_basics
Unit 2 c programming_basics
 
Introduction
IntroductionIntroduction
Introduction
 
Pointer in c
Pointer in cPointer in c
Pointer in c
 
C Token’s
C Token’sC Token’s
C Token’s
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
Compiler notes--unit-iii
Compiler notes--unit-iiiCompiler notes--unit-iii
Compiler notes--unit-iii
 
Operators in C Programming
Operators in C ProgrammingOperators in C Programming
Operators in C Programming
 
Cpu-fundamental of C
Cpu-fundamental of CCpu-fundamental of C
Cpu-fundamental of C
 
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdfPOINTERS IN C MRS.SOWMYA JYOTHI.pdf
POINTERS IN C MRS.SOWMYA JYOTHI.pdf
 
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHMCLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
CLASS VIII COMPUTERS FLOW CHART AND ALGORITHM
 
datatypes and variables in c language
 datatypes and variables in c language datatypes and variables in c language
datatypes and variables in c language
 
C++ programming
C++ programmingC++ programming
C++ programming
 
C++ revision tour
C++ revision tourC++ revision tour
C++ revision tour
 
Basics of c
Basics of cBasics of c
Basics of c
 
Problem solving with algorithm and data structure
Problem solving with algorithm and data structureProblem solving with algorithm and data structure
Problem solving with algorithm and data structure
 
C programming part4
C programming part4C programming part4
C programming part4
 
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdfUSER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
USER DEFINED FUNCTIONS IN C MRS.SOWMYA JYOTHI.pdf
 

Viewers also liked

Афиша культурных событий, июль 2013 г.
Афиша культурных событий, июль 2013 г.Афиша культурных событий, июль 2013 г.
Афиша культурных событий, июль 2013 г.Nazarovo_administration
 
Протокол публичных слушаний "Западный"
Протокол публичных слушаний "Западный"Протокол публичных слушаний "Западный"
Протокол публичных слушаний "Западный"Nazarovo_administration
 
Sepember 2012 vol 2
Sepember 2012 vol 2Sepember 2012 vol 2
Sepember 2012 vol 2thewebmaven
 
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.Nazarovo_administration
 
BackupAgent presentation on Autotask integration
BackupAgent presentation on Autotask integrationBackupAgent presentation on Autotask integration
BackupAgent presentation on Autotask integrationBackupAgent
 
ส งคม
ส งคมส งคม
ส งคม280125399
 
положение спартакиада кфк
положение спартакиада кфкположение спартакиада кфк
положение спартакиада кфкNazarovo_administration
 
Tutorial belajar membuat virtualhost di xampp linux
Tutorial belajar membuat virtualhost di xampp linuxTutorial belajar membuat virtualhost di xampp linux
Tutorial belajar membuat virtualhost di xampp linuxRiz Al-Atsary (Abu Uwais)
 
Реестр муниципальных услуг
Реестр муниципальных услугРеестр муниципальных услуг
Реестр муниципальных услугNazarovo_administration
 
Field trips project
Field trips projectField trips project
Field trips projectjaimefoster3
 
План - график создания контейнерных площадок
План - график создания контейнерных площадок План - график создания контейнерных площадок
План - график создания контейнерных площадок Nazarovo_administration
 
How to successfully sell cloud backup
How to successfully sell cloud backupHow to successfully sell cloud backup
How to successfully sell cloud backupBackupAgent
 
Реестр муниципальных услуг
Реестр муниципальных услугРеестр муниципальных услуг
Реестр муниципальных услугNazarovo_administration
 
Положение конкурса «Конституция Российской Федерации - ориентир для развития...
Положение конкурса «Конституция Российской Федерации -  ориентир для развития...Положение конкурса «Конституция Российской Федерации -  ориентир для развития...
Положение конкурса «Конституция Российской Федерации - ориентир для развития...Nazarovo_administration
 
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...Mobile Money Transfer : International Remittance Considerations for Mobile Ne...
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...Andrew Ariaratnam
 
Presentation outline!
Presentation outline!Presentation outline!
Presentation outline!Sandra Vespa
 
Manual wordbasico2010
Manual wordbasico2010Manual wordbasico2010
Manual wordbasico2010Percy R PH
 

Viewers also liked (20)

Афиша культурных событий, июль 2013 г.
Афиша культурных событий, июль 2013 г.Афиша культурных событий, июль 2013 г.
Афиша культурных событий, июль 2013 г.
 
Протокол публичных слушаний "Западный"
Протокол публичных слушаний "Западный"Протокол публичных слушаний "Западный"
Протокол публичных слушаний "Западный"
 
Eng
EngEng
Eng
 
Sepember 2012 vol 2
Sepember 2012 vol 2Sepember 2012 vol 2
Sepember 2012 vol 2
 
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.
План работы постоянной комиссии по законносте и защите прав граждан на 2014 год.
 
BackupAgent presentation on Autotask integration
BackupAgent presentation on Autotask integrationBackupAgent presentation on Autotask integration
BackupAgent presentation on Autotask integration
 
Spss
SpssSpss
Spss
 
ส งคม
ส งคมส งคม
ส งคม
 
положение спартакиада кфк
положение спартакиада кфкположение спартакиада кфк
положение спартакиада кфк
 
Tutorial belajar membuat virtualhost di xampp linux
Tutorial belajar membuat virtualhost di xampp linuxTutorial belajar membuat virtualhost di xampp linux
Tutorial belajar membuat virtualhost di xampp linux
 
Реестр муниципальных услуг
Реестр муниципальных услугРеестр муниципальных услуг
Реестр муниципальных услуг
 
Field trips project
Field trips projectField trips project
Field trips project
 
План - график создания контейнерных площадок
План - график создания контейнерных площадок План - график создания контейнерных площадок
План - график создания контейнерных площадок
 
How to successfully sell cloud backup
How to successfully sell cloud backupHow to successfully sell cloud backup
How to successfully sell cloud backup
 
Реестр муниципальных услуг
Реестр муниципальных услугРеестр муниципальных услуг
Реестр муниципальных услуг
 
Положение конкурса «Конституция Российской Федерации - ориентир для развития...
Положение конкурса «Конституция Российской Федерации -  ориентир для развития...Положение конкурса «Конституция Российской Федерации -  ориентир для развития...
Положение конкурса «Конституция Российской Федерации - ориентир для развития...
 
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...Mobile Money Transfer : International Remittance Considerations for Mobile Ne...
Mobile Money Transfer : International Remittance Considerations for Mobile Ne...
 
Presentation outline!
Presentation outline!Presentation outline!
Presentation outline!
 
Резолюция. Бюджет.
Резолюция. Бюджет.Резолюция. Бюджет.
Резолюция. Бюджет.
 
Manual wordbasico2010
Manual wordbasico2010Manual wordbasico2010
Manual wordbasico2010
 

Similar to C –imp points

Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++Rokonuzzaman Rony
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variablesTony Apreku
 
[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++Muhammad Hammad Waseem
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data TypesTareq Hasan
 
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of PrecedenceMuhammad Hammad Waseem
 
Lamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ckLamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ckseidounsemel
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C ProgrammingMOHAMAD NOH AHMAD
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 FocJAYA
 
LESSON1-C_programming (1).GRADE 8 LESSONpptx
LESSON1-C_programming (1).GRADE 8 LESSONpptxLESSON1-C_programming (1).GRADE 8 LESSONpptx
LESSON1-C_programming (1).GRADE 8 LESSONpptxjoachimbenedicttulau
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorialMohit Saini
 
M.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageM.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageDr.Florence Dayana
 

Similar to C –imp points (20)

Object Oriented Programming with C++
Object Oriented Programming with C++Object Oriented Programming with C++
Object Oriented Programming with C++
 
5 introduction-to-c
5 introduction-to-c5 introduction-to-c
5 introduction-to-c
 
C Programming
C ProgrammingC Programming
C Programming
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
Getting started with C++
Getting started with C++Getting started with C++
Getting started with C++
 
CProgrammingTutorial
CProgrammingTutorialCProgrammingTutorial
CProgrammingTutorial
 
Basics of C.ppt
Basics of C.pptBasics of C.ppt
Basics of C.ppt
 
[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++[ITP - Lecture 04] Variables and Constants in C/C++
[ITP - Lecture 04] Variables and Constants in C/C++
 
Chapter1.pptx
Chapter1.pptxChapter1.pptx
Chapter1.pptx
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 
Basics of c
Basics of cBasics of c
Basics of c
 
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
[ITP - Lecture 06] Operators, Arithmetic Expression and Order of Precedence
 
Lamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ckLamborghini Veneno Allegheri #2004@f**ck
Lamborghini Veneno Allegheri #2004@f**ck
 
C Programming
C ProgrammingC Programming
C Programming
 
Introduction to C Programming
Introduction to C ProgrammingIntroduction to C Programming
Introduction to C Programming
 
Unit 4 Foc
Unit 4 FocUnit 4 Foc
Unit 4 Foc
 
#Code2 create c++ for beginners
#Code2 create  c++ for beginners #Code2 create  c++ for beginners
#Code2 create c++ for beginners
 
LESSON1-C_programming (1).GRADE 8 LESSONpptx
LESSON1-C_programming (1).GRADE 8 LESSONpptxLESSON1-C_programming (1).GRADE 8 LESSONpptx
LESSON1-C_programming (1).GRADE 8 LESSONpptx
 
C programming tutorial
C programming tutorialC programming tutorial
C programming tutorial
 
M.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C LanguageM.Florence Dayana / Basics of C Language
M.Florence Dayana / Basics of C Language
 

Recently uploaded

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfchloefrazer622
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 

Recently uploaded (20)

A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Disha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdfDisha NEET Physics Guide for classes 11 and 12.pdf
Disha NEET Physics Guide for classes 11 and 12.pdf
 
Advance Mobile Application Development class 07
Advance Mobile Application Development class 07Advance Mobile Application Development class 07
Advance Mobile Application Development class 07
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 

C –imp points

  • 2. The C Character Set Alphabets A, B, ….., Y, Z a, b, ……, y, z Digits 0, 1, 2, 3, 4, 5, 6, 7, 8, 9 Special symbols ~‘!@#%^&*()_-+=|{} []:;"'<>,.?/  The alphabets, numbers and special symbols when properly combined form constants, variables and keywords.  A constant is an entity that doesn‟t change whereas a variable is an entity that may change.
  • 3. C stores values at memory locations which are given a particular name. x 3 x 5  Since the location whose name is x can hold different values at different times x is known as a variable. As against this, 3 or 5 do not change, hence are known as constants.
  • 4.  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.
  • 5. Following rules must be observed while constructing real constants expressed in exponential form:     The mantissa part and the exponential part should be separated by a letter e. The mantissa part may have a positive or negative sign. Default sign of mantissa part is positive. The exponent must have at least one digit, which must be a positive or negative integer. Default sign is positive.  Range of real constants expressed in exponential form is -3.4e38 to 3.4e38.  Ex.: +3.2e-5 4.1e8 -0.2e+3 -3.2e-5
  • 6. 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. Still, it would be safer to stick to the rule of 31 characters. Do not create unnecessarily long variable names as it adds to your typing effort.  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.
  • 7. C Keywords-cannot be used as variable names  The keywords are also called „Reserved words‟.  There are only 32 keywords available in C.  Note that compiler vendors (like Microsoft, Borland, etc.) provide their own keywords apart from the ones mentioned above. These include extended keywords like near, far, asm, etc.  Though it has been suggested by the ANSI committee that every such compiler specific keyword should be preceded by two underscores (as in __asm ), not every vendor follows this rule.
  • 8. C Program  C has no specific rules for the position at which a statement is to be written. That‟s why it     is often called a free-form language. Every C statement must end with a ;. Thus ; acts as a statement terminator. The statements in a program must appear in the same order in which we wish them to be executed; unless of course the logic of the problem demands a deliberate „jump‟ or transfer of control to a statement, which is out of sequence. Blank spaces may be inserted between two words to improve the readability of the statement. However, no blank spaces are allowed within a variable, constant or keyword. All statements are entered in small case letters.
  • 9. /* Calculation of simple interest */ /* Author gekay Date: 25/05/2004 */ C Program main( ) { int p, n ; float r, si ; p = 1000 ; n=3; r = 8.5 ; /* formula for simple interest */  Comments cannot be nested. For example, /* Cal of SI /* Author sam date 01/01/2002 */ */ is invalid.  −A comment can be split over more than one line, as in,  /* This is si = p * n * r / 100 ; a jazzy printf ( "%f" , si ) ; comment */ }
  • 10. /* Just for fun. Author: Bozo */ main( ) { int num ; printf ( "Enter a number" ) ;  Type declaration instruction − To declare the type of variables used in a C program. scanf ( "%d", &num ) ;  Arithmetic instruction − printf ( "Now I am letting you on a secret..." ) ; printf ( "You have just entered the number %d", num ) ; } To perform arithmetic operations between constants and variables.  Control instruction − To control the sequence of execution of various statements in a C program.
  • 11. Type declarations.  float a = 1.5, b = a + 3.1 ; is alright, but  float b = a + 3.1, a = 1.5 ; is not because we are trying to use a before it is even declared.  The following statements would work  int a, b, c, d ; a = b = c = 10 ;  However, the following statement would not work int a = b = c = d = 10 ;  Once again we are trying to use b (to assign to a) before defining it.
  • 12. Arithmetic Operations Ex.: int ad ; float kot, deta, alpha, beta, gamma ; ad = 3200 ; kot = 0.0056 ; deta = alpha * beta / gamma + 3.2 * 2 / 5; Here, *, /, -, + are the arithmetic operators. = is the assignment operator. 2, 5 and 3200 are integer constants. 3.2 and 0.0056 are real constants. ad is an integer variable. kot, deta, alpha, beta, gamma are real variables.
  • 13. Arithmetic Statement – 3 types Integer mode arithmetic statement This is an arithmetic statement in which all operands are either integer variables or integer constants. Ex.: int i, king, issac, noteit ; i=i+1; king = issac * 234 + noteit - 7689 ; Real mode arithmetic statement - This is an arithmetic statement in which all operands are either real constants or real variables. Ex.: float qbee, antink, si, prin, anoy, roi ; qbee = antink + 23.123 / 4.5 * 0.3442 ; si = prin * anoy * roi / 100.0 ;  Mixed mode arithmetic statement - This is an arithmetic statement in which some of the operands are integers and some of the operands are real.
  • 14. Arithmetic Instructions Ex.: float si, prin, anoy, roi, avg ; int a, b, c, num ; si = prin * anoy * roi / 100.0 ; avg = ( a + b + c + num ) / 4 ;  An arithmetic instruction is often used for storing character constants in character variables. char a, b, d ; a = 'F' ; b = 'G' ; d = '+' ;  C allows only one variable on left-hand side of =. That is, z = k * l is legal, whereas k * l = z is illegal.  In addition to the division operator C also provides a modular division operator. This operator returns the remainder on dividing one integer with another. Thus the expression 10 / 2 yields 5, whereas, 10 % 2 yields 0. Note that the modulus operator (%) cannot be applied on a float. Also note that on using % the sign of the remainder is always same as the sign of the numerator. Thus –5 % 2 yields –1, whereas, 5 % -2 yields 1.
  • 15. Invalid Statements     a = 3 ** 2 ; b=3^2; a = c.d.b(xy) usual arithmetic statement b = c * d * b * ( x * y ) C statement #include <math.h> main( ) { int a ; a = pow ( 3, 2 ) ; printf ( “%d”, a ) ; }