SlideShare a Scribd company logo
1 of 49
Download to read offline
Presentation By Karthik Srini
Fundamentals of Computing and C Programming
Unit II - Basics of C language
Presentation By Karthik Srini
Seminar II
By Karthik Srini
Presentation By Karthik Srini
Synopsis
1. Data Types
2. Type Conversion
3. Type Definition
4. Control Structures
Presentation By Karthik Srini
Data Types
In the C programming language, data types refer to an extensive system
used for declaring variables or functions of different types. The type of a
variable determines how much space it occupies in storage and how the
bit pattern stored is interpreted. They are categorised as :
1. Basic Data Type
2. Enumerated Data Type
3. The void Type
4. Derived Data Type
Presentation By Karthik Srini
Basic Data Types
The basic data types in C are :
1. Integer data type
2. Float data type
3. Character data type
Presentation By Karthik Srini
Integer Data Type
The integer data types are further classified as integers and characters.
Integers can be classified with respect to length and sign as,
• Unsigned Integer
• Signed Integer
• Long Integer
• Short Integer
Presentation By Karthik Srini
Signed Integer & Unsigned Integer
The are normally identified by the sign in front of the integer value. An
integer value without any sign is assumed to be positive. (i.e.)
unsigned.
For example,
unsigned int num = 10 ; ( unsigned )
int num = -10 ; ( signed )
Presentation By Karthik Srini
Long Integer
If a large integer value is to be stored in a variable, then long is
prefixed before int while declaring the variable.
For example,
If you want to store a mobile number ( 10 digits ), you declare it as ,
long int mobile_number = 1234567891 ;
Presentation By Karthik Srini
Short Integer
Short integer is normally used to reduce the size of the program, since
short int occupies less memory space than int and long int .
For example,
short num = 11 ;
Presentation By Karthik Srini
Float Data Type
Float data type is normally used to represent floating points ( or )
floating numbers, float is prefixed before the variable name.
For example,
float pi = 3.14 ;
Presentation By Karthik Srini
Double Data Type
Double data type is used to represent larger floating numbers
For example,
double num = 43.66677 ;
Presentation By Karthik Srini
Long Double Data Type
Long double data type is used to represent even larger ( or ) longer
floating numbers.
For example,
long double num = 4167.7789056 ;
Presentation By Karthik Srini
Character Data Type
It is usually used to represent characters. The variable name is
prefixed by char . Must be enclosed within single quotes.
For example,
char alphabet = ‘ c ’ ;
Presentation By Karthik Srini
Enumerated Data Types
Presentation By Karthik Srini
Enumerated Data Types
Enumerated data types are user defined data types. They are
predefined with a discrete set of values by the user.
For example,
enum month ( Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec ) ;
enum month first = Jan ;
Presentation By Karthik Srini
Type Definition
It is an user defined data type similar to enumerated data types, the
only difference is, in type definition it is not necessary to define the
discrete set of values.
For example,
typedef int number ;
number num1 , num2 ;
Presentation By Karthik Srini
The void Data Type
Void means null ( or ) nothing. It is normally prefixed before functions.
For now, this information is enough. You will learn in detail in the
forthcoming chapters.
Presentation By Karthik Srini
Derived Data Types
Presentation By Karthik Srini
Derived Data Types
They include,
(a) Pointer types,
(b) Array types,
(c) Structure types,
(d) Union types and
(e) Function types.
Presentation By Karthik Srini
Arrays
Arrays are defined as the collection of variables having the same base type
( or ) data type. Arrays are further classified as :
1. Single Dimensional Array
2. Double Dimensional Array
They are normally declared as like other declarations, but the array index
must be specified.
For example,
int num [5] ;
Presentation By Karthik Srini
int num[5];
Memory allocation for
the above array.
0 1 2 3 4
100 34 76 56 89
Presentation By Karthik Srini
Type Conversions
Presentation By Karthik Srini
Type Conversion
Conversion of values of one data type into another data type is called
Type conversion. It is classified as :
1. Implicit Type Conversion
2. Explicit Type Conversion
Presentation By Karthik Srini
Implicit Type Conversion
These are done by the complier itself, without the knowledge of the
programmer.
For example,
int b = 7 / 2 ; ( value of b will be 4 )
Presentation By Karthik Srini
Explicit Type Conversion
This type of conversion are done by the user willingly.
For example,
int pi = (int) 3.4 ;
Presentation By Karthik Srini
Functions
Presentation By Karthik Srini
Functions
A function is a group of statements that together perform a task. Every
C program has at least one function, which is main(), and all the most
trivial programs can define additional functions. You can divide up
your code into separate functions.
Presentation By Karthik Srini
Function Prototype
In computer programming, a function prototype or function interface is
a declaration of a function that specifies the function's name and type
signature (parameter types, and return type), but omits the function
body.
For example,
int add ( int a , int b )
Presentation By Karthik Srini
Control Structures
Presentation By Karthik Srini
Control Structures
Control structure decide the way of flow of control in a program. Based
on some test conditions, the control of the program gets jumped from
one point to the other. They can be further classified as :
1. Selection Statements
2. Looping Statements
Presentation By Karthik Srini
Selection Statements
The control of the program gets jumped from one point to the other
based on a test expression. They are classified as :
1. If else
2. Switch Case
Presentation By Karthik Srini
Simple if Syntax
if ( condition )
{
action block ;
}
Presentation By Karthik Srini
if else Syntax
if ( condition )
{
Action block 1 ;
}
else
{
Action block 2 ;
}
Presentation By Karthik Srini
if , else if , else Syntax
if ( condition )
{
action block 1 ;
}
else if ( condition )
{
action block 2 ;
}
else
{
action block 3 ;
}
Presentation By Karthik Srini
Switch Case Syntax
switch ( condition )
{
case 1 :
action block1 ;
break ;
case 2 :
action block2 ;
break ;
default :
action block3 ;
}
Presentation By Karthik Srini
Looping Structures
Presentation By Karthik Srini
Looping Structures
Looping is a type of control structure in which a set of instructions is
repeated again and again until the test condition evaluates to true.
There are two major types,
1. Entry controlled loop
2. Exit controlled loop
Presentation By Karthik Srini
Entry controlled loop
Checks whether the test expression evaluates to true, before the
statements in the loop gets executed. If the test expression evaluates
to false, the loop terminates.
These have two loops in major,
1. For loop
2. While Loop
Presentation By Karthik Srini
For loop
For loop has fixed number of repetitions. It is an entry controlled loop.
It consists of three main clauses namely,
1. Initialisation expression
2. Test Expression
3. Update Expression
A for loop can have multiple initialisation expressions and multiple
update expressions but can have only one test expression.
Presentation By Karthik Srini
for Loop Syntax
for ( initialisation exp ; test exp ; update exp )
{
action block ;
}
Presentation By Karthik Srini
While loop
While loop does not have fixed number of iterations. It is an entry
controlled loop.
Presentation By Karthik Srini
while Loop Syntax
initialisation expression ; ( if needed )
while ( condition )
{
action block ;
update expression ; ( if needed )
}
Presentation By Karthik Srini
Exit Controlled Loop
Checks whether the test expression evaluates to true, after the
statements in the loop gets executed. It gets executed at least once.
They have one loop in major,
1. Do While loop.
Presentation By Karthik Srini
Do While Loop
It is an exit controlled loop. Gets executed at least once.
Presentation By Karthik Srini
do while Loop Syntax
initialisation expression ;
do
{
action block ;
update expression ;
}
while ( condition ) ;
Presentation By Karthik Srini
Queries ???
Presentation By Karthik Srini
Log on to :
www.facebook.com/groups/skcetcsea
For downloading this Powerpoint presentation
Presentation By Karthik Srini
Thank You

More Related Content

What's hot

Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++K Durga Prasad
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Iffat Anjum
 
Data types in java | What is Datatypes in Java | Learning with RD | Created b...
Data types in java | What is Datatypes in Java | Learning with RD | Created b...Data types in java | What is Datatypes in Java | Learning with RD | Created b...
Data types in java | What is Datatypes in Java | Learning with RD | Created b...rahuldaredia21
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical AnalyzerArchana Gopinath
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variablesTony Apreku
 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingEelco Visser
 
Compiler Designs
Compiler DesignsCompiler Designs
Compiler Designswasim liam
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++Aahwini Esware gowda
 
Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Daniyal Mughal
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaAtul Sehdev
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction toolssunilchute1
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II NotesAndrew Raj
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysisBilalzafar22
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysisIffat Anjum
 
C programming Ms. Pranoti Doke
C programming Ms. Pranoti DokeC programming Ms. Pranoti Doke
C programming Ms. Pranoti DokePranoti Doke
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data TypesTareq Hasan
 

What's hot (20)

Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
 
C material
C materialC material
C material
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
 
Data types in java | What is Datatypes in Java | Learning with RD | Created b...
Data types in java | What is Datatypes in Java | Learning with RD | Created b...Data types in java | What is Datatypes in Java | Learning with RD | Created b...
Data types in java | What is Datatypes in Java | Learning with RD | Created b...
 
Language for specifying lexical Analyzer
Language for specifying lexical AnalyzerLanguage for specifying lexical Analyzer
Language for specifying lexical Analyzer
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
 
Compiler Designs
Compiler DesignsCompiler Designs
Compiler Designs
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
2nd PUC Computer science chapter 5 review of c++
2nd PUC Computer science chapter 5   review of c++2nd PUC Computer science chapter 5   review of c++
2nd PUC Computer science chapter 5 review of c++
 
Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6Type checking compiler construction Chapter #6
Type checking compiler construction Chapter #6
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
 
ITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in javaITFT-Constants, variables and data types in java
ITFT-Constants, variables and data types in java
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysis
 
C programming Ms. Pranoti Doke
C programming Ms. Pranoti DokeC programming Ms. Pranoti Doke
C programming Ms. Pranoti Doke
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
 

Viewers also liked

Viewers also liked (14)

ISo 19438 Fuel Filter Test Rig
ISo 19438 Fuel Filter Test RigISo 19438 Fuel Filter Test Rig
ISo 19438 Fuel Filter Test Rig
 
Oil Flat Sheet Media Test Lab
Oil  Flat Sheet Media Test LabOil  Flat Sheet Media Test Lab
Oil Flat Sheet Media Test Lab
 
Hepa filter test rig manufacturer
Hepa filter test rig manufacturerHepa filter test rig manufacturer
Hepa filter test rig manufacturer
 
Air Filter Testing Lab
Air Filter Testing LabAir Filter Testing Lab
Air Filter Testing Lab
 
Victorian-Code-of-Practice-for-the-Building-and-Construction-Industry-2014
Victorian-Code-of-Practice-for-the-Building-and-Construction-Industry-2014Victorian-Code-of-Practice-for-the-Building-and-Construction-Industry-2014
Victorian-Code-of-Practice-for-the-Building-and-Construction-Industry-2014
 
Jørn thunem
Jørn thunemJørn thunem
Jørn thunem
 
Eng brochure APT Group
 Eng brochure APT Group  Eng brochure APT Group
Eng brochure APT Group
 
APT Group - brochure english version
APT Group - brochure english versionAPT Group - brochure english version
APT Group - brochure english version
 
Fundamentals of Computing and C Programming - Part 3
Fundamentals of Computing and C Programming - Part 3Fundamentals of Computing and C Programming - Part 3
Fundamentals of Computing and C Programming - Part 3
 
GuideToFireSprinklerSystemWaterSavingIssue1
GuideToFireSprinklerSystemWaterSavingIssue1GuideToFireSprinklerSystemWaterSavingIssue1
GuideToFireSprinklerSystemWaterSavingIssue1
 
Politique prix
Politique prixPolitique prix
Politique prix
 
Tic, tac, tep
Tic, tac, tepTic, tac, tep
Tic, tac, tep
 
Politique de communication-marketing
Politique de communication-marketingPolitique de communication-marketing
Politique de communication-marketing
 
Analyse de la concurrence
Analyse de la concurrenceAnalyse de la concurrence
Analyse de la concurrence
 

Similar to Fundamentals of Computing and C Programming - Part 2

C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageRakesh Roshan
 
Computer science_xii_2016
 Computer science_xii_2016 Computer science_xii_2016
Computer science_xii_2016Ritika sahu
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12Dev Chauhan
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c languageAkshhayPatel
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniquesvalarpink
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...Indu32
 
03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...Intro C# Book
 
Module 3 : using value type variables
Module 3 : using value type variablesModule 3 : using value type variables
Module 3 : using value type variablesPrem Kumar Badri
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxNaniBhai3
 

Similar to Fundamentals of Computing and C Programming - Part 2 (20)

C language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C languageC language Unit 2 Slides, UPTU C language
C language Unit 2 Slides, UPTU C language
 
Computer science_xii_2016
 Computer science_xii_2016 Computer science_xii_2016
Computer science_xii_2016
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
 
Computer programming questions
Computer programming questionsComputer programming questions
Computer programming questions
 
Computer programming questions
Computer programming questionsComputer programming questions
Computer programming questions
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
CP Handout#3
CP Handout#3CP Handout#3
CP Handout#3
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
 
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...In this page, we will learn about the basics of OOPs. Object-Oriented Program...
In this page, we will learn about the basics of OOPs. Object-Oriented Program...
 
03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...03 and 04 .Operators, Expressions, working with the console and conditional s...
03 and 04 .Operators, Expressions, working with the console and conditional s...
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
 
Module 3 : using value type variables
Module 3 : using value type variablesModule 3 : using value type variables
Module 3 : using value type variables
 
C programming session8
C programming  session8C programming  session8
C programming session8
 
C programming session8
C programming  session8C programming  session8
C programming session8
 
CPU
CPUCPU
CPU
 
Notes on c++
Notes on c++Notes on c++
Notes on c++
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
 

More from Karthik Srini B R

More from Karthik Srini B R (7)

Forex Market Participants
Forex Market ParticipantsForex Market Participants
Forex Market Participants
 
Types Of Mergers
Types Of MergersTypes Of Mergers
Types Of Mergers
 
Analysing A Research Paper In Human Resources
Analysing A Research Paper In Human ResourcesAnalysing A Research Paper In Human Resources
Analysing A Research Paper In Human Resources
 
Deciding Incentive Schemes
Deciding Incentive SchemesDeciding Incentive Schemes
Deciding Incentive Schemes
 
Non Probability Sampling
Non Probability SamplingNon Probability Sampling
Non Probability Sampling
 
Export Credit Guarantee Corporation
Export Credit Guarantee CorporationExport Credit Guarantee Corporation
Export Credit Guarantee Corporation
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousing
 

Recently uploaded

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSKurinjimalarL3
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...asadnawaz62
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineeringmalavadedarshan25
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxpurnimasatapathy1234
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)dollysharma2066
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfAsst.prof M.Gokilavani
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girlsssuser7cb4ff
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxKartikeyaDwivedi3
 

Recently uploaded (20)

APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICSAPPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
APPLICATIONS-AC/DC DRIVES-OPERATING CHARACTERISTICS
 
complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...complete construction, environmental and economics information of biomass com...
complete construction, environmental and economics information of biomass com...
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Internship report on mechanical engineering
Internship report on mechanical engineeringInternship report on mechanical engineering
Internship report on mechanical engineering
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Microscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptxMicroscopic Analysis of Ceramic Materials.pptx
Microscopic Analysis of Ceramic Materials.pptx
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
Call Us ≽ 8377877756 ≼ Call Girls In Shastri Nagar (Delhi)
 
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdfCCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
CCS355 Neural Network & Deep Learning Unit II Notes with Question bank .pdf
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
Call Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call GirlsCall Girls Narol 7397865700 Independent Call Girls
Call Girls Narol 7397865700 Independent Call Girls
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Concrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptxConcrete Mix Design - IS 10262-2019 - .pptx
Concrete Mix Design - IS 10262-2019 - .pptx
 

Fundamentals of Computing and C Programming - Part 2

  • 1. Presentation By Karthik Srini Fundamentals of Computing and C Programming Unit II - Basics of C language
  • 2. Presentation By Karthik Srini Seminar II By Karthik Srini
  • 3. Presentation By Karthik Srini Synopsis 1. Data Types 2. Type Conversion 3. Type Definition 4. Control Structures
  • 4. Presentation By Karthik Srini Data Types In the C programming language, data types refer to an extensive system used for declaring variables or functions of different types. The type of a variable determines how much space it occupies in storage and how the bit pattern stored is interpreted. They are categorised as : 1. Basic Data Type 2. Enumerated Data Type 3. The void Type 4. Derived Data Type
  • 5. Presentation By Karthik Srini Basic Data Types The basic data types in C are : 1. Integer data type 2. Float data type 3. Character data type
  • 6. Presentation By Karthik Srini Integer Data Type The integer data types are further classified as integers and characters. Integers can be classified with respect to length and sign as, • Unsigned Integer • Signed Integer • Long Integer • Short Integer
  • 7. Presentation By Karthik Srini Signed Integer & Unsigned Integer The are normally identified by the sign in front of the integer value. An integer value without any sign is assumed to be positive. (i.e.) unsigned. For example, unsigned int num = 10 ; ( unsigned ) int num = -10 ; ( signed )
  • 8. Presentation By Karthik Srini Long Integer If a large integer value is to be stored in a variable, then long is prefixed before int while declaring the variable. For example, If you want to store a mobile number ( 10 digits ), you declare it as , long int mobile_number = 1234567891 ;
  • 9. Presentation By Karthik Srini Short Integer Short integer is normally used to reduce the size of the program, since short int occupies less memory space than int and long int . For example, short num = 11 ;
  • 10. Presentation By Karthik Srini Float Data Type Float data type is normally used to represent floating points ( or ) floating numbers, float is prefixed before the variable name. For example, float pi = 3.14 ;
  • 11. Presentation By Karthik Srini Double Data Type Double data type is used to represent larger floating numbers For example, double num = 43.66677 ;
  • 12. Presentation By Karthik Srini Long Double Data Type Long double data type is used to represent even larger ( or ) longer floating numbers. For example, long double num = 4167.7789056 ;
  • 13. Presentation By Karthik Srini Character Data Type It is usually used to represent characters. The variable name is prefixed by char . Must be enclosed within single quotes. For example, char alphabet = ‘ c ’ ;
  • 14.
  • 15. Presentation By Karthik Srini Enumerated Data Types
  • 16. Presentation By Karthik Srini Enumerated Data Types Enumerated data types are user defined data types. They are predefined with a discrete set of values by the user. For example, enum month ( Jan , Feb , Mar , Apr , May , Jun , Jul , Aug , Sep , Oct , Nov , Dec ) ; enum month first = Jan ;
  • 17. Presentation By Karthik Srini Type Definition It is an user defined data type similar to enumerated data types, the only difference is, in type definition it is not necessary to define the discrete set of values. For example, typedef int number ; number num1 , num2 ;
  • 18. Presentation By Karthik Srini The void Data Type Void means null ( or ) nothing. It is normally prefixed before functions. For now, this information is enough. You will learn in detail in the forthcoming chapters.
  • 19. Presentation By Karthik Srini Derived Data Types
  • 20. Presentation By Karthik Srini Derived Data Types They include, (a) Pointer types, (b) Array types, (c) Structure types, (d) Union types and (e) Function types.
  • 21. Presentation By Karthik Srini Arrays Arrays are defined as the collection of variables having the same base type ( or ) data type. Arrays are further classified as : 1. Single Dimensional Array 2. Double Dimensional Array They are normally declared as like other declarations, but the array index must be specified. For example, int num [5] ;
  • 22. Presentation By Karthik Srini int num[5]; Memory allocation for the above array. 0 1 2 3 4 100 34 76 56 89
  • 23. Presentation By Karthik Srini Type Conversions
  • 24. Presentation By Karthik Srini Type Conversion Conversion of values of one data type into another data type is called Type conversion. It is classified as : 1. Implicit Type Conversion 2. Explicit Type Conversion
  • 25. Presentation By Karthik Srini Implicit Type Conversion These are done by the complier itself, without the knowledge of the programmer. For example, int b = 7 / 2 ; ( value of b will be 4 )
  • 26. Presentation By Karthik Srini Explicit Type Conversion This type of conversion are done by the user willingly. For example, int pi = (int) 3.4 ;
  • 27. Presentation By Karthik Srini Functions
  • 28. Presentation By Karthik Srini Functions A function is a group of statements that together perform a task. Every C program has at least one function, which is main(), and all the most trivial programs can define additional functions. You can divide up your code into separate functions.
  • 29. Presentation By Karthik Srini Function Prototype In computer programming, a function prototype or function interface is a declaration of a function that specifies the function's name and type signature (parameter types, and return type), but omits the function body. For example, int add ( int a , int b )
  • 30. Presentation By Karthik Srini Control Structures
  • 31. Presentation By Karthik Srini Control Structures Control structure decide the way of flow of control in a program. Based on some test conditions, the control of the program gets jumped from one point to the other. They can be further classified as : 1. Selection Statements 2. Looping Statements
  • 32. Presentation By Karthik Srini Selection Statements The control of the program gets jumped from one point to the other based on a test expression. They are classified as : 1. If else 2. Switch Case
  • 33. Presentation By Karthik Srini Simple if Syntax if ( condition ) { action block ; }
  • 34. Presentation By Karthik Srini if else Syntax if ( condition ) { Action block 1 ; } else { Action block 2 ; }
  • 35. Presentation By Karthik Srini if , else if , else Syntax if ( condition ) { action block 1 ; } else if ( condition ) { action block 2 ; } else { action block 3 ; }
  • 36. Presentation By Karthik Srini Switch Case Syntax switch ( condition ) { case 1 : action block1 ; break ; case 2 : action block2 ; break ; default : action block3 ; }
  • 37. Presentation By Karthik Srini Looping Structures
  • 38. Presentation By Karthik Srini Looping Structures Looping is a type of control structure in which a set of instructions is repeated again and again until the test condition evaluates to true. There are two major types, 1. Entry controlled loop 2. Exit controlled loop
  • 39. Presentation By Karthik Srini Entry controlled loop Checks whether the test expression evaluates to true, before the statements in the loop gets executed. If the test expression evaluates to false, the loop terminates. These have two loops in major, 1. For loop 2. While Loop
  • 40. Presentation By Karthik Srini For loop For loop has fixed number of repetitions. It is an entry controlled loop. It consists of three main clauses namely, 1. Initialisation expression 2. Test Expression 3. Update Expression A for loop can have multiple initialisation expressions and multiple update expressions but can have only one test expression.
  • 41. Presentation By Karthik Srini for Loop Syntax for ( initialisation exp ; test exp ; update exp ) { action block ; }
  • 42. Presentation By Karthik Srini While loop While loop does not have fixed number of iterations. It is an entry controlled loop.
  • 43. Presentation By Karthik Srini while Loop Syntax initialisation expression ; ( if needed ) while ( condition ) { action block ; update expression ; ( if needed ) }
  • 44. Presentation By Karthik Srini Exit Controlled Loop Checks whether the test expression evaluates to true, after the statements in the loop gets executed. It gets executed at least once. They have one loop in major, 1. Do While loop.
  • 45. Presentation By Karthik Srini Do While Loop It is an exit controlled loop. Gets executed at least once.
  • 46. Presentation By Karthik Srini do while Loop Syntax initialisation expression ; do { action block ; update expression ; } while ( condition ) ;
  • 47. Presentation By Karthik Srini Queries ???
  • 48. Presentation By Karthik Srini Log on to : www.facebook.com/groups/skcetcsea For downloading this Powerpoint presentation
  • 49. Presentation By Karthik Srini Thank You