SlideShare a Scribd company logo
1 of 29
FUNDAMENTALS OF “C”
GOVERNMENTENGINEERING COLLEGE
BHARUCH
SUB:- COMPUTER PROGRAMMINGAND
UTILIZATION
• RATHVA RAVIKUMAR 160140119093
• RATHOD PRASHANANT 160140119094
• RATHVA RAHULKUMAR 160140119095
• RAVAL KRUNAL 160140119096
Comments:-
• Comments are used in a programme to improve the
understanding.
• Comments are not executed, rather they are ignored by the
compiler.
• Comments help the programme to understand the various
operations of a program and serve as an aid to debugging and
testing.
• Single line comments start with // symbol and multiple line
comments are written within /* and */.
Header files:-
• A header file is a file with extension .h which contains C
function declarations and macro definitions to be shared
between several source files. There are two types of header
files: the files that the programmer writes and the files that
comes with your compiler
Character set:-
• The character set is the fundamental raw material of any
language and they are used to represent information. Like
natural languages, computer language will also have well
defined character set, which is useful to build the programs.
Alphabets. Uppercase letters A-Z.
• Characters are used to write tokens .these characters are defined
by the Unicode character set.
• The C Character set includes letter , digits, special characters
and white spaces as building blocks to form blocks to form
basic programming elements.
Character set:-
Tokens:-
• A programming token is the basic component of source code .
Character s are categorized as one of five classes of tokens that
describe their functions (constants, identifiers, operators,
reserved words, and separators) in accordance with. the rules of
the programming language
Keywords:-
•Auto:
• Defines a local variable as having a local lifetime.
• Keyword auto uses the following syntax:
• [auto] data-definition
• As the local lifetime is the default for local variables, auto keyword is
extremely rarely used.
•Break:
• Passes control out of the compound statement.
• The break statement causes control to pass to the statement following the
innermost enclosing while, do, for, or switch statement.
• The syntax is simply:
• break;
Const:-
• Makes variable value or pointer parameter unmodifiable.
• When const is used with a variable, it uses the following syntax:
• const variable-name [ = value];
• In this case, the const modifier allows you to assign an initial
value to a variable that cannot later be changed by the program.
For example,
Continue:-
• Passes control to the begining of the loop.
• continue causes control to pass to the end of the innermost
enclosing while, do, or for statement, at which point the loop
continuation condition is re-evaluated.
• The syntax is simply:
• Continue
Do/Do-while loop:-
• Keyword do is usually used together with while to make another form
of repeating statement.
• Such form of the loop uses the following syntax:
• do statement while (expression)e;
Enum :-
• Defines a set of constants of type int.
• The syntax for defining constants using enum is
• enum [tag] {name [=value], ...};
Float, double:-
• The keyword float usually represents a single precision floating point data
type, and double represents a double precision floating point data type. In
TIGCC, both float and double (and even long double) are the same. The TI-89
and TI-92 Plus use a non-IEEE floating point format called SMAP II BCD for
floating point values.
These values have a range from 1e-999 to 9.999999999999999e999 in
magnitude, with a precision of exactly 16 significant digits. Principally, the
exponent range may be as high as 16383, but a lot of math routines do not
accept exponents greater than 999.
For loop:-
• For-loop is yet another kind of loop. It uses for keyword, with
the following syntax:
• for ([expr1]; [expr2]; [expr3]) statement
Goto :-
• goto may be used for transfering control from one place to
another. The syntax is:
• Goto identifier; Control is unconditionally transferred to the
location of a local label specified by identifier. For example,
• Again: ... Goto Again;
While:-
• Repeats execution while the condition is true.
• Keyword while is the most general loop statemens. It uses the
following syntax:
• while (expression) statement
Basic data types (integer and
character:-
• Variables of type int are one machine-type word in length. They can
be signed (default) or unsigned, which means that in this
configuration of the compiler they have by default a range of -32768
to 32767 and 0 to 65535 respectively, but this default may be changed
if the compiler option '-mnoshort' is given. In this case, the range of
type int is -2147483648 to 2147483647 for signed case, or 0 to
4294967295 for unsigned case. See also short and long type modifiers
Identifiers:-
• Alphabets, digits, underscores are permitted.
• They must not begin with a digit.
• First character must be letter.
• They may also begin with an underscore.
• Uppercase and lower case letters are distinct.
• They can be of any length however the frist 8 characters are
treated as significant by the C compiler.
• Declared keywords cannot be used as variable.
Constants:-
Constants:-
Constant Type of Value Stored
Integer Constant Constant which stores integer value
Floating Constant Constant which stores float value
Character Constant Constant which stores character value
String Constant Constant which stores string value
Integer constants:-
• Any whole number value is an integer.
• An integer constant refers to a sequence of digits without a
decimal point.
• An integer preceded by a unary minus may be considered to
represent a negative constant
• Example: 0 -33 32767
There are three types of integer constants namely,
a) Decimal integer constant
b) Octal integer constant
c) Hexadecimal integer constant
Decimal Integer constant :-
• It consists of any combinations of digits taken from the
set 0 through 9, preceded by an optional – or + sign.
• The first digit must be other than 0.
• Embedded spaces, commas, and non-digit characters are not
permitted between digits.
• Valid: 0 32767 -9999 -23
Invalid:
12,245 - Illegal character (,)
10 20 30 - Illegal character (blank space)
•Octal Integer Constant :-
• It consists of any combinations of digits taken from the
set 0 through 7.
• If a constant contains two or more digits, the first digit must be
0.
• In programming, octal numbers are used.
• Valid: 037 0 0435
Invalid:
0786 - Illegal digit 8
123 - Does not begin with
zero
01.2 - Illegal character (.)
Hexadecimal integer constant :-
• It consists of any combinations of digits taken from the set 0 through 7 and
also a through f (either uppercase or lowercase).
• The letters a through f (or A through F) represent the decimal
quantities 10 through 15 respectively.
• This constant must begin with either 0x or 0X.
• In programming, hexadecimal numbers are used.
• Valid Hexadecimal Integer
Constant: 0x 0X1 0x7F
Invalid Hexadecimal Integer Constant:
0xefg - Illegal character g
123 - Does not begin with 0x
Unsigned integer constant:-
An unsigned integer constant specifies only positive integer value. It is used only to count
things. This constant can be identified by appending the letter u or U to the end of the
constant.
Valid: 0u 1U 65535u 0x233AU
Invalid: -123 - Only positive value
Long integer constant:-
A long integer constant will automatically be generated simply by specifying a constant that
exceeds the normal maximum value. It is used only to count things. This constant can be
identified by appending the letter l or L to the end of the constant.
Valid: 0l23456L 0x123456L -123456l
Invalid: 0x1.2L - Illegal character (.)
Short integer constant:-
A short integer constant specifies small integer value. This constant can be identified by
appending the letter s or S to the end of the constant.
Valid: 123s -456 32767S
Invalid:
12,245 - Illegal character (,)
10 20 30 - Illegal character (blank space
Character constants:-
String constant:-
• It contains sequence of characters enclosed in double qutation
marks.
• String constants are enclosed in double quotes "". A string
contains characters that are similar to character literals: plain
characters, escape sequences, and universal characters.
• You can break a long line into multiple lines using string literals
and separating them using white spaces.
• Here are some examples of string literals. All the three forms
are identical strings.
• "hello, dear" "hello,  dear" "hello, " "d" "ear"
Backslash character constants
(Escape sequences):-
• Enclosing character constants in single quotes works for most
printing characters
• .A few , however, such as carriage return, can't be. For this
reason, C includes special backslash character constants, so that
you may easily enter these special characters as constants.
• You should use the backslash codes instead of their ASCII
equivalents to help insure portability.
• List of backslash character constants are as follows:-
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(very small sound)
• ? Question mark
• N Octal constant (N is an octal
constant)
• xN Hexadecimal constant (N
is an hexadecimal constant)
•
Special symbols:-
• Parethesis ( ) : Used for surrounding cast types.
• Braces{ } : Used to initialize the arrays, used to define a block
of code.
• Brackets[ ] : Used to declare array types.
• Semicolon; : Used to separate statements.
• Comma,:Used to separate identifiers in a variable declaration.
• Ampersand & : Used to assign the address of the location of
variable. used in the scanf function.
Data types:-
Data types:
THANK YOU

More Related Content

What's hot

Strings-Computer programming
Strings-Computer programmingStrings-Computer programming
Strings-Computer programmingnmahi96
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cppsharvivek
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiSowmya Jyothi
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ LanguageWay2itech
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction toolssunilchute1
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C ProgrammingQazi Shahzad Ali
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data typesPratik Devmurari
 
Pointers-Computer programming
Pointers-Computer programmingPointers-Computer programming
Pointers-Computer programmingnmahi96
 
Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)nmahi96
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programmingnmahi96
 
Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vballdesign
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_outputAnil Dutt
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programmingprogramming9
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C ProgrammingKamal Acharya
 
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
 

What's hot (20)

Strings-Computer programming
Strings-Computer programmingStrings-Computer programming
Strings-Computer programming
 
12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp12 computer science_notes_ch01_overview_of_cpp
12 computer science_notes_ch01_overview_of_cpp
 
Declaration of variables
Declaration of variablesDeclaration of variables
Declaration of variables
 
Data types in C
Data types in CData types in C
Data types in C
 
Strings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothiStrings in c mrs.sowmya jyothi
Strings in c mrs.sowmya jyothi
 
Variables in C and C++ Language
Variables in C and C++ LanguageVariables in C and C++ Language
Variables in C and C++ Language
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
Data Type in C Programming
Data Type in C ProgrammingData Type in C Programming
Data Type in C Programming
 
Constant, variables, data types
Constant, variables, data typesConstant, variables, data types
Constant, variables, data types
 
Pointers-Computer programming
Pointers-Computer programmingPointers-Computer programming
Pointers-Computer programming
 
Computer programming(CP)
Computer programming(CP)Computer programming(CP)
Computer programming(CP)
 
Functions-Computer programming
Functions-Computer programmingFunctions-Computer programming
Functions-Computer programming
 
Data types and operators in vb
Data types and operators  in vbData types and operators  in vb
Data types and operators in vb
 
Basic of c &c++
Basic of c &c++Basic of c &c++
Basic of c &c++
 
Structure of c_program_to_input_output
Structure of c_program_to_input_outputStructure of c_program_to_input_output
Structure of c_program_to_input_output
 
Constants in C Programming
Constants in C ProgrammingConstants in C Programming
Constants in C Programming
 
Ch02
Ch02Ch02
Ch02
 
Unit 8. Pointers
Unit 8. PointersUnit 8. Pointers
Unit 8. Pointers
 
Data Types and Variables In C Programming
Data Types and Variables In C ProgrammingData Types and Variables In C Programming
Data Types and Variables In C Programming
 
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
 

Viewers also liked (16)

c programme
c programmec programme
c programme
 
CHAPTER 3
CHAPTER 3CHAPTER 3
CHAPTER 3
 
Ch2 introduction to c
Ch2 introduction to cCh2 introduction to c
Ch2 introduction to c
 
ધોરણ - ૧૦ ગુજરાતી વ્યાકરણ છંદ
ધોરણ - ૧૦ ગુજરાતી વ્યાકરણ છંદ ધોરણ - ૧૦ ગુજરાતી વ્યાકરણ છંદ
ધોરણ - ૧૦ ગુજરાતી વ્યાકરણ છંદ
 
Prefix Postfix
Prefix PostfixPrefix Postfix
Prefix Postfix
 
Can my English course be translated to Tamil language?
Can my English course be translated to Tamil language?Can my English course be translated to Tamil language?
Can my English course be translated to Tamil language?
 
Indian army
Indian armyIndian army
Indian army
 
Function in C program
Function in C programFunction in C program
Function in C program
 
Indian Army
Indian ArmyIndian Army
Indian Army
 
Indian army
Indian armyIndian army
Indian army
 
Encuesta sobre las redes sociales
Encuesta sobre las redes socialesEncuesta sobre las redes sociales
Encuesta sobre las redes sociales
 
поширення оксигену.Pptx
поширення оксигену.Pptxпоширення оксигену.Pptx
поширення оксигену.Pptx
 
12. neraca pembayaran
12. neraca pembayaran12. neraca pembayaran
12. neraca pembayaran
 
Budova atoma.ppt
Budova atoma.pptBudova atoma.ppt
Budova atoma.ppt
 
BabanKumbhar
BabanKumbharBabanKumbhar
BabanKumbhar
 
palliativ omsorg rev 2
palliativ omsorg rev 2palliativ omsorg rev 2
palliativ omsorg rev 2
 

Similar to Fundamentals of C programming language basics

C Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptxC Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptxMurali M
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxMamataAnilgod
 
Data types slides by Faixan
Data types slides by FaixanData types slides by Faixan
Data types slides by FaixanٖFaiXy :)
 
Programming fundamental 02.pptx
Programming fundamental 02.pptxProgramming fundamental 02.pptx
Programming fundamental 02.pptxZubairAli256321
 
CONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CCONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CSahithi Naraparaju
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.pptFatimaZafar68
 
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
 
Constant and variacles in c
Constant   and variacles in cConstant   and variacles in c
Constant and variacles in cyash patel
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variablesyarkhosh
 
C programming language
C programming languageC programming language
C programming languageAbin Rimal
 

Similar to Fundamentals of C programming language basics (20)

lec 2.pptx
lec 2.pptxlec 2.pptx
lec 2.pptx
 
C tokens.pptx
C tokens.pptxC tokens.pptx
C tokens.pptx
 
C Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptxC Programming Lecture 3 - Elements of C.pptx
C Programming Lecture 3 - Elements of C.pptx
 
INTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptxINTRODUCTION TO C++.pptx
INTRODUCTION TO C++.pptx
 
All C ppt.ppt
All C ppt.pptAll C ppt.ppt
All C ppt.ppt
 
C PROGRAMING.pptx
C PROGRAMING.pptxC PROGRAMING.pptx
C PROGRAMING.pptx
 
Data types slides by Faixan
Data types slides by FaixanData types slides by Faixan
Data types slides by Faixan
 
C programming language
C programming languageC programming language
C programming language
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Basics of c++
Basics of c++Basics of c++
Basics of c++
 
C PADHLO FRANDS.pdf
C PADHLO FRANDS.pdfC PADHLO FRANDS.pdf
C PADHLO FRANDS.pdf
 
Programming fundamental 02.pptx
Programming fundamental 02.pptxProgramming fundamental 02.pptx
Programming fundamental 02.pptx
 
Constants variables data_types
Constants variables data_typesConstants variables data_types
Constants variables data_types
 
CONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN CCONSTANTS, VARIABLES & DATATYPES IN C
CONSTANTS, VARIABLES & DATATYPES IN C
 
programming week 2.ppt
programming week 2.pptprogramming week 2.ppt
programming week 2.ppt
 
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
 
Ch7 Basic Types
Ch7 Basic TypesCh7 Basic Types
Ch7 Basic Types
 
Constant and variacles in c
Constant   and variacles in cConstant   and variacles in c
Constant and variacles in c
 
Escape Sequences and Variables
Escape Sequences and VariablesEscape Sequences and Variables
Escape Sequences and Variables
 
C programming language
C programming languageC programming language
C programming language
 

More from KRUNAL RAVAL

PRESSURIZED FLUIDIZED BED COMBUSTION BOILER
PRESSURIZED FLUIDIZED BED COMBUSTION BOILERPRESSURIZED FLUIDIZED BED COMBUSTION BOILER
PRESSURIZED FLUIDIZED BED COMBUSTION BOILERKRUNAL RAVAL
 
FRICTION AND EXPLOSION WELDING
FRICTION AND EXPLOSION WELDINGFRICTION AND EXPLOSION WELDING
FRICTION AND EXPLOSION WELDINGKRUNAL RAVAL
 
MICROSCOPIC & MACROSCOPIC POINT OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...
MICROSCOPIC & MACROSCOPIC POINT   OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...MICROSCOPIC & MACROSCOPIC POINT   OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...
MICROSCOPIC & MACROSCOPIC POINT OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...KRUNAL RAVAL
 
ENVIRONMENTAL DEGRADATION
ENVIRONMENTAL  DEGRADATIONENVIRONMENTAL  DEGRADATION
ENVIRONMENTAL DEGRADATIONKRUNAL RAVAL
 
COMPUTER AIDED PROCESS PLANNING (CAPP)
COMPUTER AIDED PROCESS PLANNING (CAPP)COMPUTER AIDED PROCESS PLANNING (CAPP)
COMPUTER AIDED PROCESS PLANNING (CAPP)KRUNAL RAVAL
 
FAILURE OF ROLLING CONTACT BEARING
FAILURE OF ROLLING CONTACT BEARINGFAILURE OF ROLLING CONTACT BEARING
FAILURE OF ROLLING CONTACT BEARINGKRUNAL RAVAL
 
BASICS OF ENGINEERING THERMODYNAMICS
BASICS  OF ENGINEERING THERMODYNAMICSBASICS  OF ENGINEERING THERMODYNAMICS
BASICS OF ENGINEERING THERMODYNAMICSKRUNAL RAVAL
 

More from KRUNAL RAVAL (9)

PRESSURIZED FLUIDIZED BED COMBUSTION BOILER
PRESSURIZED FLUIDIZED BED COMBUSTION BOILERPRESSURIZED FLUIDIZED BED COMBUSTION BOILER
PRESSURIZED FLUIDIZED BED COMBUSTION BOILER
 
EXPANSION DEVICES
EXPANSION DEVICESEXPANSION DEVICES
EXPANSION DEVICES
 
CHIP FORMATION
CHIP FORMATIONCHIP FORMATION
CHIP FORMATION
 
FRICTION AND EXPLOSION WELDING
FRICTION AND EXPLOSION WELDINGFRICTION AND EXPLOSION WELDING
FRICTION AND EXPLOSION WELDING
 
MICROSCOPIC & MACROSCOPIC POINT OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...
MICROSCOPIC & MACROSCOPIC POINT   OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...MICROSCOPIC & MACROSCOPIC POINT   OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...
MICROSCOPIC & MACROSCOPIC POINT OF VIEW , THERMODYNAMIC SYSTEM & CONTROL VO...
 
ENVIRONMENTAL DEGRADATION
ENVIRONMENTAL  DEGRADATIONENVIRONMENTAL  DEGRADATION
ENVIRONMENTAL DEGRADATION
 
COMPUTER AIDED PROCESS PLANNING (CAPP)
COMPUTER AIDED PROCESS PLANNING (CAPP)COMPUTER AIDED PROCESS PLANNING (CAPP)
COMPUTER AIDED PROCESS PLANNING (CAPP)
 
FAILURE OF ROLLING CONTACT BEARING
FAILURE OF ROLLING CONTACT BEARINGFAILURE OF ROLLING CONTACT BEARING
FAILURE OF ROLLING CONTACT BEARING
 
BASICS OF ENGINEERING THERMODYNAMICS
BASICS  OF ENGINEERING THERMODYNAMICSBASICS  OF ENGINEERING THERMODYNAMICS
BASICS OF ENGINEERING THERMODYNAMICS
 

Recently uploaded

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxwendy cai
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingrakeshbaidya232001
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSRajkumarAkumalla
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxhumanexperienceaaa
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝soniya singh
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSCAESB
 

Recently uploaded (20)

(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
(RIA) Call Girls Bhosari ( 7001035870 ) HI-Fi Pune Escorts Service
 
What are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptxWhat are the advantages and disadvantages of membrane structures.pptx
What are the advantages and disadvantages of membrane structures.pptx
 
Porous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writingPorous Ceramics seminar and technical writing
Porous Ceramics seminar and technical writing
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICSHARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
HARDNESS, FRACTURE TOUGHNESS AND STRENGTH OF CERAMICS
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptxthe ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
the ladakh protest in leh ladakh 2024 sonam wangchuk.pptx
 
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
Model Call Girl in Narela Delhi reach out to us at 🔝8264348440🔝
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
GDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentationGDSC ASEB Gen AI study jams presentation
GDSC ASEB Gen AI study jams presentation
 

Fundamentals of C programming language basics

  • 1. FUNDAMENTALS OF “C” GOVERNMENTENGINEERING COLLEGE BHARUCH SUB:- COMPUTER PROGRAMMINGAND UTILIZATION • RATHVA RAVIKUMAR 160140119093 • RATHOD PRASHANANT 160140119094 • RATHVA RAHULKUMAR 160140119095 • RAVAL KRUNAL 160140119096
  • 2. Comments:- • Comments are used in a programme to improve the understanding. • Comments are not executed, rather they are ignored by the compiler. • Comments help the programme to understand the various operations of a program and serve as an aid to debugging and testing. • Single line comments start with // symbol and multiple line comments are written within /* and */.
  • 3. Header files:- • A header file is a file with extension .h which contains C function declarations and macro definitions to be shared between several source files. There are two types of header files: the files that the programmer writes and the files that comes with your compiler
  • 4. Character set:- • The character set is the fundamental raw material of any language and they are used to represent information. Like natural languages, computer language will also have well defined character set, which is useful to build the programs. Alphabets. Uppercase letters A-Z. • Characters are used to write tokens .these characters are defined by the Unicode character set. • The C Character set includes letter , digits, special characters and white spaces as building blocks to form blocks to form basic programming elements.
  • 6. Tokens:- • A programming token is the basic component of source code . Character s are categorized as one of five classes of tokens that describe their functions (constants, identifiers, operators, reserved words, and separators) in accordance with. the rules of the programming language
  • 7. Keywords:- •Auto: • Defines a local variable as having a local lifetime. • Keyword auto uses the following syntax: • [auto] data-definition • As the local lifetime is the default for local variables, auto keyword is extremely rarely used. •Break: • Passes control out of the compound statement. • The break statement causes control to pass to the statement following the innermost enclosing while, do, for, or switch statement. • The syntax is simply: • break;
  • 8. Const:- • Makes variable value or pointer parameter unmodifiable. • When const is used with a variable, it uses the following syntax: • const variable-name [ = value]; • In this case, the const modifier allows you to assign an initial value to a variable that cannot later be changed by the program. For example,
  • 9. Continue:- • Passes control to the begining of the loop. • continue causes control to pass to the end of the innermost enclosing while, do, or for statement, at which point the loop continuation condition is re-evaluated. • The syntax is simply: • Continue Do/Do-while loop:- • Keyword do is usually used together with while to make another form of repeating statement. • Such form of the loop uses the following syntax: • do statement while (expression)e;
  • 10. Enum :- • Defines a set of constants of type int. • The syntax for defining constants using enum is • enum [tag] {name [=value], ...}; Float, double:- • The keyword float usually represents a single precision floating point data type, and double represents a double precision floating point data type. In TIGCC, both float and double (and even long double) are the same. The TI-89 and TI-92 Plus use a non-IEEE floating point format called SMAP II BCD for floating point values. These values have a range from 1e-999 to 9.999999999999999e999 in magnitude, with a precision of exactly 16 significant digits. Principally, the exponent range may be as high as 16383, but a lot of math routines do not accept exponents greater than 999.
  • 11. For loop:- • For-loop is yet another kind of loop. It uses for keyword, with the following syntax: • for ([expr1]; [expr2]; [expr3]) statement Goto :- • goto may be used for transfering control from one place to another. The syntax is: • Goto identifier; Control is unconditionally transferred to the location of a local label specified by identifier. For example, • Again: ... Goto Again;
  • 12. While:- • Repeats execution while the condition is true. • Keyword while is the most general loop statemens. It uses the following syntax: • while (expression) statement Basic data types (integer and character:- • Variables of type int are one machine-type word in length. They can be signed (default) or unsigned, which means that in this configuration of the compiler they have by default a range of -32768 to 32767 and 0 to 65535 respectively, but this default may be changed if the compiler option '-mnoshort' is given. In this case, the range of type int is -2147483648 to 2147483647 for signed case, or 0 to 4294967295 for unsigned case. See also short and long type modifiers
  • 13. Identifiers:- • Alphabets, digits, underscores are permitted. • They must not begin with a digit. • First character must be letter. • They may also begin with an underscore. • Uppercase and lower case letters are distinct. • They can be of any length however the frist 8 characters are treated as significant by the C compiler. • Declared keywords cannot be used as variable.
  • 14.
  • 16. Constants:- Constant Type of Value Stored Integer Constant Constant which stores integer value Floating Constant Constant which stores float value Character Constant Constant which stores character value String Constant Constant which stores string value
  • 17. Integer constants:- • Any whole number value is an integer. • An integer constant refers to a sequence of digits without a decimal point. • An integer preceded by a unary minus may be considered to represent a negative constant • Example: 0 -33 32767 There are three types of integer constants namely, a) Decimal integer constant b) Octal integer constant c) Hexadecimal integer constant
  • 18. Decimal Integer constant :- • It consists of any combinations of digits taken from the set 0 through 9, preceded by an optional – or + sign. • The first digit must be other than 0. • Embedded spaces, commas, and non-digit characters are not permitted between digits. • Valid: 0 32767 -9999 -23 Invalid: 12,245 - Illegal character (,) 10 20 30 - Illegal character (blank space)
  • 19. •Octal Integer Constant :- • It consists of any combinations of digits taken from the set 0 through 7. • If a constant contains two or more digits, the first digit must be 0. • In programming, octal numbers are used. • Valid: 037 0 0435 Invalid: 0786 - Illegal digit 8 123 - Does not begin with zero 01.2 - Illegal character (.)
  • 20. Hexadecimal integer constant :- • It consists of any combinations of digits taken from the set 0 through 7 and also a through f (either uppercase or lowercase). • The letters a through f (or A through F) represent the decimal quantities 10 through 15 respectively. • This constant must begin with either 0x or 0X. • In programming, hexadecimal numbers are used. • Valid Hexadecimal Integer Constant: 0x 0X1 0x7F Invalid Hexadecimal Integer Constant: 0xefg - Illegal character g 123 - Does not begin with 0x
  • 21. Unsigned integer constant:- An unsigned integer constant specifies only positive integer value. It is used only to count things. This constant can be identified by appending the letter u or U to the end of the constant. Valid: 0u 1U 65535u 0x233AU Invalid: -123 - Only positive value Long integer constant:- A long integer constant will automatically be generated simply by specifying a constant that exceeds the normal maximum value. It is used only to count things. This constant can be identified by appending the letter l or L to the end of the constant. Valid: 0l23456L 0x123456L -123456l Invalid: 0x1.2L - Illegal character (.) Short integer constant:- A short integer constant specifies small integer value. This constant can be identified by appending the letter s or S to the end of the constant. Valid: 123s -456 32767S Invalid: 12,245 - Illegal character (,) 10 20 30 - Illegal character (blank space
  • 23. String constant:- • It contains sequence of characters enclosed in double qutation marks. • String constants are enclosed in double quotes "". A string contains characters that are similar to character literals: plain characters, escape sequences, and universal characters. • You can break a long line into multiple lines using string literals and separating them using white spaces. • Here are some examples of string literals. All the three forms are identical strings. • "hello, dear" "hello, dear" "hello, " "d" "ear"
  • 24. Backslash character constants (Escape sequences):- • Enclosing character constants in single quotes works for most printing characters • .A few , however, such as carriage return, can't be. For this reason, C includes special backslash character constants, so that you may easily enter these special characters as constants. • You should use the backslash codes instead of their ASCII equivalents to help insure portability. • List of backslash character constants are as follows:-
  • 25. 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(very small sound) • ? Question mark • N Octal constant (N is an octal constant) • xN Hexadecimal constant (N is an hexadecimal constant) •
  • 26. Special symbols:- • Parethesis ( ) : Used for surrounding cast types. • Braces{ } : Used to initialize the arrays, used to define a block of code. • Brackets[ ] : Used to declare array types. • Semicolon; : Used to separate statements. • Comma,:Used to separate identifiers in a variable declaration. • Ampersand & : Used to assign the address of the location of variable. used in the scanf function.