SlideShare a Scribd company logo
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 ’ ;
Fundamentals of Computing and C Programming - Part 2
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 (20)

Getting started with c++
Getting started with c++Getting started with c++
Getting started with c++
K Durga Prasad
 
C material
C materialC material
C material
tarique472
 
Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2Lecture 11 semantic analysis 2
Lecture 11 semantic analysis 2
Iffat 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 Analyzer
Archana Gopinath
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
Eelco Visser
 
Compiler Designs
Compiler DesignsCompiler Designs
Compiler Designs
wasim liam
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
Chetan Mahawar
 
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 #6
Daniyal Mughal
 
Syntax analysis
Syntax analysisSyntax analysis
Syntax analysis
Binsent Ribera
 
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
Atul Sehdev
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
sunilchute1
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes
Andrew Raj
 
Lecture 4
Lecture 4Lecture 4
Lecture 4
Debasish Pratihari
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
Bilalzafar22
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysis
Iffat Anjum
 
C programming Ms. Pranoti Doke
C programming Ms. Pranoti DokeC programming Ms. Pranoti Doke
C programming Ms. Pranoti Doke
Pranoti Doke
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
Tareq Hasan
 
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 2
Iffat 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 Analyzer
Archana Gopinath
 
Lecture 2 variables
Lecture 2 variablesLecture 2 variables
Lecture 2 variables
Tony Apreku
 
Compiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type CheckingCompiler Construction | Lecture 7 | Type Checking
Compiler Construction | Lecture 7 | Type Checking
Eelco Visser
 
Compiler Designs
Compiler DesignsCompiler Designs
Compiler Designs
wasim 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 #6
Daniyal 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 java
Atul Sehdev
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
sunilchute1
 
+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes+2 Computer Science - Volume II Notes
+2 Computer Science - Volume II Notes
Andrew Raj
 
Semantics analysis
Semantics analysisSemantics analysis
Semantics analysis
Bilalzafar22
 
Lecture 02 lexical analysis
Lecture 02 lexical analysisLecture 02 lexical analysis
Lecture 02 lexical analysis
Iffat Anjum
 
C programming Ms. Pranoti Doke
C programming Ms. Pranoti DokeC programming Ms. Pranoti Doke
C programming Ms. Pranoti Doke
Pranoti Doke
 
Java: Primitive Data Types
Java: Primitive Data TypesJava: Primitive Data Types
Java: Primitive Data Types
Tareq Hasan
 

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
Filtration Engineering & Consultant
 
Oil Flat Sheet Media Test Lab
Oil  Flat Sheet Media Test LabOil  Flat Sheet Media Test Lab
Oil Flat Sheet Media Test Lab
Filtration Engineering & Consultant
 
Hepa filter test rig manufacturer
Hepa filter test rig manufacturerHepa filter test rig manufacturer
Hepa filter test rig manufacturer
Filtration Engineering & Consultant
 
Air Filter Testing Lab
Air Filter Testing LabAir Filter Testing Lab
Air Filter Testing Lab
Filtration Engineering & Consultant
 
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
sam fattal
 
Jørn thunem
Jørn thunemJørn thunem
Jørn thunem
jorthu
 
Eng brochure APT Group
 Eng brochure APT Group  Eng brochure APT Group
Eng brochure APT Group
Alessandro Cantoni
 
APT Group - brochure english version
APT Group - brochure english versionAPT Group - brochure english version
APT Group - brochure english version
Alessandro Cantoni
 
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
Karthik Srini B R
 
GuideToFireSprinklerSystemWaterSavingIssue1
GuideToFireSprinklerSystemWaterSavingIssue1GuideToFireSprinklerSystemWaterSavingIssue1
GuideToFireSprinklerSystemWaterSavingIssue1
sam fattal
 
Politique prix
Politique prixPolitique prix
Politique prix
souka ina
 
Tic, tac, tep
Tic, tac, tepTic, tac, tep
Tic, tac, tep
Samuel Monterrey Romero
 
Politique de communication-marketing
Politique de communication-marketingPolitique de communication-marketing
Politique de communication-marketing
souka ina
 
Analyse de la concurrence
Analyse de la concurrenceAnalyse de la concurrence
Analyse de la concurrence
souka ina
 

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
Anurag University Hyderabad
 
Computer science_xii_2016
 Computer science_xii_2016 Computer science_xii_2016
Computer science_xii_2016
Ritika sahu
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
Dev Chauhan
 
Computer programming questions
Computer programming questionsComputer programming questions
Computer programming questions
estoredesignerclothi
 
Computer programming questions
Computer programming questionsComputer programming questions
Computer programming questions
estoredesignerclothi
 
Programming_in_C_language_Unit5.pptx course ATOT
Programming_in_C_language_Unit5.pptx course ATOTProgramming_in_C_language_Unit5.pptx course ATOT
Programming_in_C_language_Unit5.pptx course ATOT
jagmeetsidhu0012
 
Introduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOPIntroduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOP
UbaidKhan930128
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
AkshhayPatel
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
Mufaddal Nullwala
 
CP Handout#3
CP Handout#3CP Handout#3
CP Handout#3
trupti1976
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
valarpink
 
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
 
unit 1 (1).pptx
unit 1 (1).pptxunit 1 (1).pptx
unit 1 (1).pptx
PriyadarshiniS28
 
introduction to programming using ANSI C
introduction to programming using ANSI Cintroduction to programming using ANSI C
introduction to programming using ANSI C
JNTUK KAKINADA
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
Jasleen Kaur (Chandigarh University)
 
PSPC--UNIT-2.pdf
PSPC--UNIT-2.pdfPSPC--UNIT-2.pdf
PSPC--UNIT-2.pdf
ArshiniGubbala3
 
Core Java and Data Structure using C++.pptx
Core Java and Data Structure using C++.pptxCore Java and Data Structure using C++.pptx
Core Java and Data Structure using C++.pptx
rawatsatish0327
 
Module 3 : using value type variables
Module 3 : using value type variablesModule 3 : using value type variables
Module 3 : using value type variables
Prem Kumar Badri
 
C programming session8
C programming  session8C programming  session8
C programming session8
Keroles karam khalil
 
Computer science_xii_2016
 Computer science_xii_2016 Computer science_xii_2016
Computer science_xii_2016
Ritika sahu
 
BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12BASIC CONCEPTS OF C++ CLASS 12
BASIC CONCEPTS OF C++ CLASS 12
Dev Chauhan
 
Programming_in_C_language_Unit5.pptx course ATOT
Programming_in_C_language_Unit5.pptx course ATOTProgramming_in_C_language_Unit5.pptx course ATOT
Programming_in_C_language_Unit5.pptx course ATOT
jagmeetsidhu0012
 
Introduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOPIntroduction to C++.pptx learn c++ and basic concepts of OOP
Introduction to C++.pptx learn c++ and basic concepts of OOP
UbaidKhan930128
 
Fundamentals of c language
Fundamentals of c languageFundamentals of c language
Fundamentals of c language
AkshhayPatel
 
Problem Solving Techniques
Problem Solving TechniquesProblem Solving Techniques
Problem Solving Techniques
valarpink
 
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
 
introduction to programming using ANSI C
introduction to programming using ANSI Cintroduction to programming using ANSI C
introduction to programming using ANSI C
JNTUK KAKINADA
 
Core Java and Data Structure using C++.pptx
Core Java and Data Structure using C++.pptxCore Java and Data Structure using C++.pptx
Core Java and Data Structure using C++.pptx
rawatsatish0327
 
Module 3 : using value type variables
Module 3 : using value type variablesModule 3 : using value type variables
Module 3 : using value type variables
Prem Kumar Badri
 

More from Karthik Srini B R (7)

Forex Market Participants
Forex Market ParticipantsForex Market Participants
Forex Market Participants
Karthik Srini B R
 
Types Of Mergers
Types Of MergersTypes Of Mergers
Types Of Mergers
Karthik Srini B R
 
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
Karthik Srini B R
 
Deciding Incentive Schemes
Deciding Incentive SchemesDeciding Incentive Schemes
Deciding Incentive Schemes
Karthik Srini B R
 
Non Probability Sampling
Non Probability SamplingNon Probability Sampling
Non Probability Sampling
Karthik Srini B R
 
Export Credit Guarantee Corporation
Export Credit Guarantee CorporationExport Credit Guarantee Corporation
Export Credit Guarantee Corporation
Karthik Srini B R
 
Data Warehousing
Data WarehousingData Warehousing
Data Warehousing
Karthik Srini B R
 

Recently uploaded (20)

DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Development of MLR, ANN and ANFIS Models for Estimation of PCUs at Different ...
Journal of Soft Computing in Civil Engineering
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
DATA-DRIVEN SHOULDER INVERSE KINEMATICS YoungBeom Kim1 , Byung-Ha Park1 , Kwa...
charlesdick1345
 
fluke dealers in bangalore..............
fluke dealers in bangalore..............fluke dealers in bangalore..............
fluke dealers in bangalore..............
Haresh Vaswani
 
Raish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdfRaish Khanji GTU 8th sem Internship Report.pdf
Raish Khanji GTU 8th sem Internship Report.pdf
RaishKhanji
 
comparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.pptcomparison of motors.pptx 1. Motor Terminology.ppt
comparison of motors.pptx 1. Motor Terminology.ppt
yadavmrr7
 
Value Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous SecurityValue Stream Mapping Worskshops for Intelligent Continuous Security
Value Stream Mapping Worskshops for Intelligent Continuous Security
Marc Hornbeek
 
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdffive-year-soluhhhhhhhhhhhhhhhhhtions.pdf
five-year-soluhhhhhhhhhhhhhhhhhtions.pdf
AdityaSharma944496
 
Smart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptxSmart_Storage_Systems_Production_Engineering.pptx
Smart_Storage_Systems_Production_Engineering.pptx
rushikeshnavghare94
 
Avnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights FlyerAvnet Silica's PCIM 2025 Highlights Flyer
Avnet Silica's PCIM 2025 Highlights Flyer
WillDavies22
 
railway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forgingrailway wheels, descaling after reheating and before forging
railway wheels, descaling after reheating and before forging
Javad Kadkhodapour
 
Crack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By VivekCrack the Domain with Event Storming By Vivek
Crack the Domain with Event Storming By Vivek
Vivek Srivastava
 
IntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdfIntroSlides-April-BuildWithAI-VertexAI.pdf
IntroSlides-April-BuildWithAI-VertexAI.pdf
Luiz Carneiro
 
Artificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptxArtificial Intelligence (AI) basics.pptx
Artificial Intelligence (AI) basics.pptx
aditichinar
 
Engineering Chemistry First Year Fullerenes
Engineering Chemistry First Year FullerenesEngineering Chemistry First Year Fullerenes
Engineering Chemistry First Year Fullerenes
5g2jpd9sp4
 
Mirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdfMirada a 12 proyectos desarrollados con BIM.pdf
Mirada a 12 proyectos desarrollados con BIM.pdf
topitodosmasdos
 
Degree_of_Automation.pdf for Instrumentation and industrial specialist
Degree_of_Automation.pdf for  Instrumentation  and industrial specialistDegree_of_Automation.pdf for  Instrumentation  and industrial specialist
Degree_of_Automation.pdf for Instrumentation and industrial specialist
shreyabhosale19
 
Reagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptxReagent dosing (Bredel) presentation.pptx
Reagent dosing (Bredel) presentation.pptx
AlejandroOdio
 
π0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalizationπ0.5: a Vision-Language-Action Model with Open-World Generalization
π0.5: a Vision-Language-Action Model with Open-World Generalization
NABLAS株式会社
 
Machine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptxMachine learning project on employee attrition detection using (2).pptx
Machine learning project on employee attrition detection using (2).pptx
rajeswari89780
 
aset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edgeaset and manufacturing optimization and connecting edge
aset and manufacturing optimization and connecting edge
alilamisse
 

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 ’ ;
  • 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