SlideShare a Scribd company logo
1 of 10
VIDYA CLASES
Asstt. Professor
Department of computer science and IT
 There are various types of data that a variable may contain in a
programming language . All such types are named as data type
Derived Data
type
Data Types in
c
Primary Data
Types
User
Defined
Data Type
Data Types in c
Primary Data Types
User
Defined
Data
types
Derive
d Data
types
Class
Stucure
Union
Array
Function
Pointer
Primary Data Types
Integral
type Void
Floating
Point
TYpe
Integer Characte
r
Signed Unsigne
d
Int
Short int
Long int
Unsigned int
Unsigned short
int
Unsigned long
int
Float
Double
Long double
Char
Signed char
Unsigned char
Integer Type
Integer are those nos with a range of values supported by a particular machine. Generaly integer occupy one
word of storage.The size of an integer that can be stored depends on the computer.
Integer are of two types 1)signed 2)unsigned
• Short int takes two bytes of memory and long int takes four bytes of the main memory of a computer.
• If we want to declare an integer variable to be non-negative only the use the unsigned
Like unsigned int k, unsigned short m, unsigned long n
Floating point type
Floating point means real nos. Floating point nos. are defined by keyword float. Real nos are stored in 32 bits
with 6 digits precision.The double data type nos uses 64 bits with a precision of 14 digits.
Character type
Characters are usually stored in 8 bits of internal storage.Unsigned char have values between 0 to 255 and
signed char have values from -128 to 127
• Using scanf function we can given a values to variables
• The general format of scanf function is
Scanf(“control string”,&variable1,,&varable2…….);
Or scanf(“%f%d%c”,&a,&b,&c);
Printf(“control string”,arg1,arg2,….argn)
Eg.
Printf(“values=%d”,n);
/*Prog. Explaining basic arithmetic operators*/
#include<stdio.h>
#include<conio.h>
void main()
{
Int x,y;
Int add,sub,div,mul;
X=100;
Y=25;
Add=x+y;
Sub=x-y;
Mul=x*y;
Div=x/y;
Printf(“add=%d”,add);
Printf(“sub=%d”,sub);
Printf(“mult=%d”,mul);
Printf(“div=%d”,div);
getch();
Short
int a=20 Long
intb=20
10001 10002
&a=10001 &b=10002
THANKS

More Related Content

Similar to lecture 3 bca 1 year.pptx

Similar to lecture 3 bca 1 year.pptx (20)

Data Handling
Data HandlingData Handling
Data Handling
 
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
 
C++ data types
C++ data typesC++ data types
C++ data types
 
Programming construction tools
Programming construction toolsProgramming construction tools
Programming construction tools
 
Lecture 2
Lecture 2Lecture 2
Lecture 2
 
Datatypes
DatatypesDatatypes
Datatypes
 
Data types
Data typesData types
Data types
 
Data types
Data typesData types
Data types
 
What are variables and keywords in c++
What are variables and keywords in c++What are variables and keywords in c++
What are variables and keywords in c++
 
Unit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.pptUnit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.ppt
 
Notes of programming
Notes of programmingNotes of programming
Notes of programming
 
Memory management of datatypes
Memory management of datatypesMemory management of datatypes
Memory management of datatypes
 
5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt5-Lec - Datatypes.ppt
5-Lec - Datatypes.ppt
 
Chapter 2.datatypes and operators
Chapter 2.datatypes and operatorsChapter 2.datatypes and operators
Chapter 2.datatypes and operators
 
datatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptxdatatypes-200723165518 (1).pptx
datatypes-200723165518 (1).pptx
 
Structured Languages
Structured LanguagesStructured Languages
Structured Languages
 
Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)Fundamental of C Programming (Data Types)
Fundamental of C Programming (Data Types)
 
C programming notes.pdf
C programming notes.pdfC programming notes.pdf
C programming notes.pdf
 
Introduction to c++
Introduction to c++Introduction to c++
Introduction to c++
 
Data type
Data typeData type
Data type
 

More from classall (20)

E -COMMERCE.ppt
E -COMMERCE.pptE -COMMERCE.ppt
E -COMMERCE.ppt
 
CONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VBCONTROL STRUCTURE IN VB
CONTROL STRUCTURE IN VB
 
operat in vb .pptx
operat in vb .pptxoperat in vb .pptx
operat in vb .pptx
 
Tally_Tutor_1.ppt
Tally_Tutor_1.pptTally_Tutor_1.ppt
Tally_Tutor_1.ppt
 
networking
networking networking
networking
 
introduction to visual basic PPT.pptx
introduction to visual basic PPT.pptxintroduction to visual basic PPT.pptx
introduction to visual basic PPT.pptx
 
introduction to e-commerce.pptx
introduction to e-commerce.pptxintroduction to e-commerce.pptx
introduction to e-commerce.pptx
 
E-Rdiagram.ppt
E-Rdiagram.pptE-Rdiagram.ppt
E-Rdiagram.ppt
 
EDI presentation.pptx
EDI presentation.pptxEDI presentation.pptx
EDI presentation.pptx
 
control structure in visual basic
control structure in visual basic control structure in visual basic
control structure in visual basic
 
b,Sc it data structure.ppt
b,Sc it data structure.pptb,Sc it data structure.ppt
b,Sc it data structure.ppt
 
SAVE WATER SAVE LIFE
SAVE WATER SAVE LIFESAVE WATER SAVE LIFE
SAVE WATER SAVE LIFE
 
MS OFFICE
MS OFFICEMS OFFICE
MS OFFICE
 
MULTIMEDIA
MULTIMEDIAMULTIMEDIA
MULTIMEDIA
 
GEETA2.pptx
GEETA2.pptxGEETA2.pptx
GEETA2.pptx
 
GEETA1.pptx
GEETA1.pptxGEETA1.pptx
GEETA1.pptx
 
GEETA.pptx
GEETA.pptxGEETA.pptx
GEETA.pptx
 
राष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.pptराष्ट्रीय एकता 13.3.18.ppt
राष्ट्रीय एकता 13.3.18.ppt
 
mmu.pptx
mmu.pptxmmu.pptx
mmu.pptx
 
b,Sc it data structure.pptx
b,Sc it data structure.pptxb,Sc it data structure.pptx
b,Sc it data structure.pptx
 

Recently uploaded

Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
heathfieldcps1
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
PECB
 

Recently uploaded (20)

General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Role Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptxRole Of Transgenic Animal In Target Validation-1.pptx
Role Of Transgenic Animal In Target Validation-1.pptx
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Unit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptxUnit-IV; Professional Sales Representative (PSR).pptx
Unit-IV; Professional Sales Representative (PSR).pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 

lecture 3 bca 1 year.pptx

  • 1. VIDYA CLASES Asstt. Professor Department of computer science and IT
  • 2.  There are various types of data that a variable may contain in a programming language . All such types are named as data type Derived Data type Data Types in c Primary Data Types User Defined Data Type
  • 3. Data Types in c Primary Data Types User Defined Data types Derive d Data types Class Stucure Union Array Function Pointer
  • 4. Primary Data Types Integral type Void Floating Point TYpe Integer Characte r Signed Unsigne d Int Short int Long int Unsigned int Unsigned short int Unsigned long int Float Double Long double Char Signed char Unsigned char
  • 5. Integer Type Integer are those nos with a range of values supported by a particular machine. Generaly integer occupy one word of storage.The size of an integer that can be stored depends on the computer. Integer are of two types 1)signed 2)unsigned • Short int takes two bytes of memory and long int takes four bytes of the main memory of a computer. • If we want to declare an integer variable to be non-negative only the use the unsigned Like unsigned int k, unsigned short m, unsigned long n Floating point type Floating point means real nos. Floating point nos. are defined by keyword float. Real nos are stored in 32 bits with 6 digits precision.The double data type nos uses 64 bits with a precision of 14 digits. Character type Characters are usually stored in 8 bits of internal storage.Unsigned char have values between 0 to 255 and signed char have values from -128 to 127
  • 6. • Using scanf function we can given a values to variables • The general format of scanf function is Scanf(“control string”,&variable1,,&varable2…….); Or scanf(“%f%d%c”,&a,&b,&c);
  • 8. /*Prog. Explaining basic arithmetic operators*/ #include<stdio.h> #include<conio.h> void main() { Int x,y; Int add,sub,div,mul; X=100; Y=25; Add=x+y; Sub=x-y; Mul=x*y; Div=x/y; Printf(“add=%d”,add); Printf(“sub=%d”,sub); Printf(“mult=%d”,mul); Printf(“div=%d”,div); getch();
  • 9. Short int a=20 Long intb=20 10001 10002 &a=10001 &b=10002