際際滷

際際滷Share a Scribd company logo
DATA TYPESIn C\C++ , data are mainly divided into three different types. These are:1. Character  type data2. Integer type data           3. Real data type
1. Character data type:Characters (letters, digits and punctuation character)Are represented by the char data type. The short data type is the same size as  char ,usually one byte.
	Character data type:Character data type must be signed and unsigned (either short or long). Both occupying one byte each, but have different ranges. To begin with, it might appear strange as to how a char can have a sign. Consider the statementChar ch=AChar ty=BChar ze=D etc.
Character data type:A signed char is same as an ordinary char and has a range from -128 	to  +127: where as, unsigned char  has a range from 0 to 255. let us now see a program below#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Char ch=291;Printf(\n%c,ch);Getch();}
2. Integer data type:Integer data type (whole numbers) are represented by int.Some time, we know in advance that the value stored in a given integer variable will always be positive when it is being used to only count things.We can declared it as below.Int a=20;Int b=40;Int c=30; etc
3: Float data type:Those number which are in decimal fraction are represented by float.We can show float numbers in printf statement of C\C++ by %f.Float number are declared asFloat a=40.00Float b=23.04Float c=10.3 etc
Float data type:We can write a program as:#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Float a=29.1;Printf(\n%f,a);Getch();}
Integer data type:We can write a program in C\C++ are as shown below.#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Int a=291;Printf(\n%d,a);Getch();}We can show the integer data type in C|C++ by %d  in printf statement.
CONSTANTS:Unlike variable, a constant is a fixed value that does not change during the execution of program. We can say that constant is a values while variable are holders of these values. In C|C++, a constant may be divided into main two types.Numeric constant.Non-numeric constant.
NUMERIC CONSTANT:Numbers are referred to as numeric constants. Numeric constants are used for numeric purposes. It contain:Numeric digits 0 to 9.Plus(+) or minus(-) signs.Decimal pointsIt is important to that note no commas or blanks are allowed in numeric constants.
In C|C++, numeric constant can be represented in three ways.Integer constantFloating constantExponential real constant
Data types
OCTAL INTEGER CONSTANT:In C|C++ , any integer constant with a leading 0, is interpreted as Octal constant an octal constant is a base 8 numbers system and valid digits in octal system are only 0 through 7. it is important to note that in C|C++ , decimal integer constant cannot start with a leading 0.
HEXADECIMAL INTEGER CONSTANTIn C\C++ any integer constant, which begins with 0x or 0X, is interpreted as hexadecimal integer constant. An hexadecimal constant is a base -16 number and valid digit in hexadecimal system are 0 through 9,A,B,C,D,E and F.
FLOATING POINT CONSTANT:The numeric constant, which does not contain a decimal point is known as floating point constant. Like integer constant, floating points could either be positive or negative.
NON NUMERIC CONSTANT:Non numeric constant are used for non numeric purposes. Such as to produce output reports, heading or printing messages etc, non numeric constant are divided into two types.Character constantString constant
EXPONENTIAL REAL CONSTANT:Floating point constant can also be represented in the E-notation form, and this type of numeric constant is known as exponential real constant.
CHARACTER CONSTANT:In C\C++, character constant are enclosed within single quotes. It is important to note that the single quotes are not part of the character constant, but they serve to delimit it.
STRING CONSTANT:Any character or sequence of character between double quotes is known as string constant or simply a string.
ZAHID HUSSAINClass no : 	322Subject :	Data types, ConstantsShift :	EveningSubmitted to UMAR ALI SIR
Ad

Recommended

Numeric Data Types & Strings
Numeric Data Types & Strings
Abhinav Porwal
Data types
Data types
Zahid Hussain
Data types
Data types
Syed Umair
Datatype in c++ unit 3 -topic 2
Datatype in c++ unit 3 -topic 2
MOHIT TOMAR
Constant, variables, data types
Constant, variables, data types
Pratik Devmurari
constants, variables and datatypes in C
constants, variables and datatypes in C
Sahithi Naraparaju
C data types, arrays and structs
C data types, arrays and structs
Saad Sheikh
Data types in C
Data types in C
Tarun Sharma
Data Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
C++ data types
C++ data types
pratikborsadiya
Computer data type and Terminologies
Computer data type and Terminologies
glyvive
Data types and Operators
Data types and Operators
raksharao
data types in C programming
data types in C programming
Harshita Yadav
Concept of c data types
Concept of c data types
Manisha Keim
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
Kuntal Bhowmick
Data types
Data types
Nokesh Prabhakar
Data type in c
Data type in c
thirumalaikumar3
3 data-types-in-c
3 data-types-in-c
teach4uin
Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
Variables in C++, data types in c++
Variables in C++, data types in c++
Neeru Mittal
datatypes and variables in c language
datatypes and variables in c language
Rai University
Constants and variables in c programming
Constants and variables in c programming
Chitrank Dixit
Constants in C Programming
Constants in C Programming
programming9
Data types in C language
Data types in C language
kashyap399
Tokens in C++
Tokens in C++
Mahender Boda
Numerical data.
Numerical data.
Adewumi Ezekiel Adebayo
Data Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
Data type
Data type
Isha Aggarwal
Constants variables data_types
Constants variables data_types
NAVEEN SHARMA'S CLASSROOM
Constants, Variables, and Data Types
Constants, Variables, and Data Types
Rokonuzzaman Rony

More Related Content

What's hot (20)

Data Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
C++ data types
C++ data types
pratikborsadiya
Computer data type and Terminologies
Computer data type and Terminologies
glyvive
Data types and Operators
Data types and Operators
raksharao
data types in C programming
data types in C programming
Harshita Yadav
Concept of c data types
Concept of c data types
Manisha Keim
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
Kuntal Bhowmick
Data types
Data types
Nokesh Prabhakar
Data type in c
Data type in c
thirumalaikumar3
3 data-types-in-c
3 data-types-in-c
teach4uin
Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
Variables in C++, data types in c++
Variables in C++, data types in c++
Neeru Mittal
datatypes and variables in c language
datatypes and variables in c language
Rai University
Constants and variables in c programming
Constants and variables in c programming
Chitrank Dixit
Constants in C Programming
Constants in C Programming
programming9
Data types in C language
Data types in C language
kashyap399
Tokens in C++
Tokens in C++
Mahender Boda
Numerical data.
Numerical data.
Adewumi Ezekiel Adebayo
Data Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya
Data type
Data type
Isha Aggarwal
Data Type in C Programming
Data Type in C Programming
Qazi Shahzad Ali
Computer data type and Terminologies
Computer data type and Terminologies
glyvive
Data types and Operators
Data types and Operators
raksharao
data types in C programming
data types in C programming
Harshita Yadav
Concept of c data types
Concept of c data types
Manisha Keim
2 expressions (ppt-2) in C++
2 expressions (ppt-2) in C++
Kuntal Bhowmick
3 data-types-in-c
3 data-types-in-c
teach4uin
Basic Data Types in C++
Basic Data Types in C++
Hridoy Bepari
Variables in C++, data types in c++
Variables in C++, data types in c++
Neeru Mittal
datatypes and variables in c language
datatypes and variables in c language
Rai University
Constants and variables in c programming
Constants and variables in c programming
Chitrank Dixit
Constants in C Programming
Constants in C Programming
programming9
Data types in C language
Data types in C language
kashyap399
Data Types and Variables In C Programming
Data Types and Variables In C Programming
Kamal Acharya

Similar to Data types (20)

Constants variables data_types
Constants variables data_types
NAVEEN SHARMA'S CLASSROOM
Constants, Variables, and Data Types
Constants, Variables, and Data Types
Rokonuzzaman Rony
CHAPTER-2.ppt
CHAPTER-2.ppt
Tekle12
COM1407: Variables and Data Types
COM1407: Variables and Data Types
Hemantha Kulathilake
Mesics lecture 3 c constants and variables
Mesics lecture 3 c constants and variables
eShikshak
Datatypes
Datatypes
ZTE Nepal
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2
rohassanie
2. Variables and Data Types in C++ proramming.pptx
2. Variables and Data Types in C++ proramming.pptx
Ahmad177077
Introduction to C Programming - R.D.Sivakumar
Introduction to C Programming - R.D.Sivakumar
Sivakumar R D .
Introduction to C language programming.pptx
Introduction to C language programming.pptx
OVIDMAMAH
Data Handling
Data Handling
Praveen M Jigajinni
Introduction to C Programming -Lecture 2
Introduction to C Programming -Lecture 2
Faculty of Computers and Informatics, Suez Canal University, Ismailia, Egypt
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
SowmyaJyothi3
Data types in c language
Data types in c language
HarihamShiwani
Programming in C Basics
Programming in C Basics
Bharat Kalia
Cbasic
Cbasic
rohitladdu
Week 02_Development Environment of C++.pdf
Week 02_Development Environment of C++.pdf
salmankhizar3
A Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and Expressions
Inan Mashrur
Unit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.ppt
pubgnewstate1620
Module 1:Introduction
Module 1:Introduction
nikshaikh786
Constants, Variables, and Data Types
Constants, Variables, and Data Types
Rokonuzzaman Rony
CHAPTER-2.ppt
CHAPTER-2.ppt
Tekle12
COM1407: Variables and Data Types
COM1407: Variables and Data Types
Hemantha Kulathilake
Mesics lecture 3 c constants and variables
Mesics lecture 3 c constants and variables
eShikshak
Datatypes
Datatypes
ZTE Nepal
FP 201 Unit 2 - Part 2
FP 201 Unit 2 - Part 2
rohassanie
2. Variables and Data Types in C++ proramming.pptx
2. Variables and Data Types in C++ proramming.pptx
Ahmad177077
Introduction to C Programming - R.D.Sivakumar
Introduction to C Programming - R.D.Sivakumar
Sivakumar R D .
Introduction to C language programming.pptx
Introduction to C language programming.pptx
OVIDMAMAH
Constants Variables Datatypes by Mrs. Sowmya Jyothi
Constants Variables Datatypes by Mrs. Sowmya Jyothi
SowmyaJyothi3
Data types in c language
Data types in c language
HarihamShiwani
Programming in C Basics
Programming in C Basics
Bharat Kalia
Week 02_Development Environment of C++.pdf
Week 02_Development Environment of C++.pdf
salmankhizar3
A Closer Look at Data Types, Variables and Expressions
A Closer Look at Data Types, Variables and Expressions
Inan Mashrur
Unit 1 Built in Data types in C language.ppt
Unit 1 Built in Data types in C language.ppt
pubgnewstate1620
Module 1:Introduction
Module 1:Introduction
nikshaikh786
Ad

Recently uploaded (20)

WHO KILLED ALASKA? #28: Bobby Time - "THE HUNT FOR THE HAND" TRANSCRIPT
WHO KILLED ALASKA? #28: Bobby Time - "THE HUNT FOR THE HAND" TRANSCRIPT
Optimistic18
Reasons why basketball is my favorite hobby?
Reasons why basketball is my favorite hobby?
memi27
Presentation1 bio 2.pdf This to know about my life i am rengooz.
Presentation1 bio 2.pdf This to know about my life i am rengooz.
RenGooZ SBUH
Lit Quiz Finals || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia ||...
Lit Quiz Finals || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia ||...
BITS Goa Quiz Club
How Enzo Zelocchi Leveraged 28 Million Followers to Build a Global Brand That...
How Enzo Zelocchi Leveraged 28 Million Followers to Build a Global Brand That...
Enzo Zelocchi Fan Page
"Thug Life" (.2025.) +FuMove! Downoad Fre ゐ, ю & p
"Thug Life" (.2025.) +FuMove! Downoad Fre ゐ, ю & p
Ahsan Khan
Reasons why dancing is my favorite hobby
Reasons why dancing is my favorite hobby
memi27
Ralf Schumacher_ The Shadow and the Spotlight in Formula One.docx
Ralf Schumacher_ The Shadow and the Spotlight in Formula One.docx
voice ofarticle
Retail Store Scavenger Hunt feat. MAD MONK
Retail Store Scavenger Hunt feat. MAD MONK
jahudson
Past simple, present perfect or present perfect continuous
Past simple, present perfect or present perfect continuous
trucn4
Season 12 _ EP 01 _ Lieutenant Quiz.pptx
Season 12 _ EP 01 _ Lieutenant Quiz.pptx
Quiz Club, Indian Institute of Technology, Patna
The Bet - Concept Teaser v06 Storyboards
The Bet - Concept Teaser v06 Storyboards
Jim Mortensen
Season 12_EP02 - Quiz Quiz Hota Hai.pptx
Season 12_EP02 - Quiz Quiz Hota Hai.pptx
Quiz Club, Indian Institute of Technology, Patna
Reasons why dancing iw my favorite hobby favorite hobby (2).pptx
Reasons why dancing iw my favorite hobby favorite hobby (2).pptx
memi27
Season 12 _ EP03 - The Coked up Quiz .pdf
Season 12 _ EP03 - The Coked up Quiz .pdf
Quiz Club, Indian Institute of Technology, Patna
Internet Quiz - Prelims || Aditya Shiva Sharma, Druva and Haaziq || Midnight ...
Internet Quiz - Prelims || Aditya Shiva Sharma, Druva and Haaziq || Midnight ...
BITS Goa Quiz Club
Internet Quiz - Finals || Aditya Shiva Sharma, Druva and Haaziq || Midnight Q...
Internet Quiz - Finals || Aditya Shiva Sharma, Druva and Haaziq || Midnight Q...
BITS Goa Quiz Club
Lit Quiz Prelims || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia |...
Lit Quiz Prelims || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia |...
BITS Goa Quiz Club
Ganimatoonics Finals || QM: Agastya and Nikhil || Quark'25 || BITS Pilani, KK...
Ganimatoonics Finals || QM: Agastya and Nikhil || Quark'25 || BITS Pilani, KK...
BITS Goa Quiz Club
EDM Training - Fire Prevention & Protection.pptx
EDM Training - Fire Prevention & Protection.pptx
mujtaba1mk
WHO KILLED ALASKA? #28: Bobby Time - "THE HUNT FOR THE HAND" TRANSCRIPT
WHO KILLED ALASKA? #28: Bobby Time - "THE HUNT FOR THE HAND" TRANSCRIPT
Optimistic18
Reasons why basketball is my favorite hobby?
Reasons why basketball is my favorite hobby?
memi27
Presentation1 bio 2.pdf This to know about my life i am rengooz.
Presentation1 bio 2.pdf This to know about my life i am rengooz.
RenGooZ SBUH
Lit Quiz Finals || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia ||...
Lit Quiz Finals || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia ||...
BITS Goa Quiz Club
How Enzo Zelocchi Leveraged 28 Million Followers to Build a Global Brand That...
How Enzo Zelocchi Leveraged 28 Million Followers to Build a Global Brand That...
Enzo Zelocchi Fan Page
"Thug Life" (.2025.) +FuMove! Downoad Fre ゐ, ю & p
"Thug Life" (.2025.) +FuMove! Downoad Fre ゐ, ю & p
Ahsan Khan
Reasons why dancing is my favorite hobby
Reasons why dancing is my favorite hobby
memi27
Ralf Schumacher_ The Shadow and the Spotlight in Formula One.docx
Ralf Schumacher_ The Shadow and the Spotlight in Formula One.docx
voice ofarticle
Retail Store Scavenger Hunt feat. MAD MONK
Retail Store Scavenger Hunt feat. MAD MONK
jahudson
Past simple, present perfect or present perfect continuous
Past simple, present perfect or present perfect continuous
trucn4
The Bet - Concept Teaser v06 Storyboards
The Bet - Concept Teaser v06 Storyboards
Jim Mortensen
Reasons why dancing iw my favorite hobby favorite hobby (2).pptx
Reasons why dancing iw my favorite hobby favorite hobby (2).pptx
memi27
Internet Quiz - Prelims || Aditya Shiva Sharma, Druva and Haaziq || Midnight ...
Internet Quiz - Prelims || Aditya Shiva Sharma, Druva and Haaziq || Midnight ...
BITS Goa Quiz Club
Internet Quiz - Finals || Aditya Shiva Sharma, Druva and Haaziq || Midnight Q...
Internet Quiz - Finals || Aditya Shiva Sharma, Druva and Haaziq || Midnight Q...
BITS Goa Quiz Club
Lit Quiz Prelims || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia |...
Lit Quiz Prelims || QM: Shivansh Verma, Dhruba Chatterjee & Suhani Timbadia |...
BITS Goa Quiz Club
Ganimatoonics Finals || QM: Agastya and Nikhil || Quark'25 || BITS Pilani, KK...
Ganimatoonics Finals || QM: Agastya and Nikhil || Quark'25 || BITS Pilani, KK...
BITS Goa Quiz Club
EDM Training - Fire Prevention & Protection.pptx
EDM Training - Fire Prevention & Protection.pptx
mujtaba1mk
Ad

Data types

  • 1. DATA TYPESIn C\C++ , data are mainly divided into three different types. These are:1. Character type data2. Integer type data 3. Real data type
  • 2. 1. Character data type:Characters (letters, digits and punctuation character)Are represented by the char data type. The short data type is the same size as char ,usually one byte.
  • 3. Character data type:Character data type must be signed and unsigned (either short or long). Both occupying one byte each, but have different ranges. To begin with, it might appear strange as to how a char can have a sign. Consider the statementChar ch=AChar ty=BChar ze=D etc.
  • 4. Character data type:A signed char is same as an ordinary char and has a range from -128 to +127: where as, unsigned char has a range from 0 to 255. let us now see a program below#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Char ch=291;Printf(\n%c,ch);Getch();}
  • 5. 2. Integer data type:Integer data type (whole numbers) are represented by int.Some time, we know in advance that the value stored in a given integer variable will always be positive when it is being used to only count things.We can declared it as below.Int a=20;Int b=40;Int c=30; etc
  • 6. 3: Float data type:Those number which are in decimal fraction are represented by float.We can show float numbers in printf statement of C\C++ by %f.Float number are declared asFloat a=40.00Float b=23.04Float c=10.3 etc
  • 7. Float data type:We can write a program as:#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Float a=29.1;Printf(\n%f,a);Getch();}
  • 8. Integer data type:We can write a program in C\C++ are as shown below.#include<conio.h>#include<stdio.h>#include<stdlib.h>Void main(){Int a=291;Printf(\n%d,a);Getch();}We can show the integer data type in C|C++ by %d in printf statement.
  • 9. CONSTANTS:Unlike variable, a constant is a fixed value that does not change during the execution of program. We can say that constant is a values while variable are holders of these values. In C|C++, a constant may be divided into main two types.Numeric constant.Non-numeric constant.
  • 10. NUMERIC CONSTANT:Numbers are referred to as numeric constants. Numeric constants are used for numeric purposes. It contain:Numeric digits 0 to 9.Plus(+) or minus(-) signs.Decimal pointsIt is important to that note no commas or blanks are allowed in numeric constants.
  • 11. In C|C++, numeric constant can be represented in three ways.Integer constantFloating constantExponential real constant
  • 13. OCTAL INTEGER CONSTANT:In C|C++ , any integer constant with a leading 0, is interpreted as Octal constant an octal constant is a base 8 numbers system and valid digits in octal system are only 0 through 7. it is important to note that in C|C++ , decimal integer constant cannot start with a leading 0.
  • 14. HEXADECIMAL INTEGER CONSTANTIn C\C++ any integer constant, which begins with 0x or 0X, is interpreted as hexadecimal integer constant. An hexadecimal constant is a base -16 number and valid digit in hexadecimal system are 0 through 9,A,B,C,D,E and F.
  • 15. FLOATING POINT CONSTANT:The numeric constant, which does not contain a decimal point is known as floating point constant. Like integer constant, floating points could either be positive or negative.
  • 16. NON NUMERIC CONSTANT:Non numeric constant are used for non numeric purposes. Such as to produce output reports, heading or printing messages etc, non numeric constant are divided into two types.Character constantString constant
  • 17. EXPONENTIAL REAL CONSTANT:Floating point constant can also be represented in the E-notation form, and this type of numeric constant is known as exponential real constant.
  • 18. CHARACTER CONSTANT:In C\C++, character constant are enclosed within single quotes. It is important to note that the single quotes are not part of the character constant, but they serve to delimit it.
  • 19. STRING CONSTANT:Any character or sequence of character between double quotes is known as string constant or simply a string.
  • 20. ZAHID HUSSAINClass no : 322Subject : Data types, ConstantsShift : EveningSubmitted to UMAR ALI SIR