Use app×
Join Bloom Tuition
One on One Online Tuition
JEE MAIN 2025 Foundation Course
NEET 2025 Foundation Course
CLASS 12 FOUNDATION COURSE
CLASS 10 FOUNDATION COURSE
CLASS 9 FOUNDATION COURSE
CLASS 8 FOUNDATION COURSE
0 votes
137 views
in Data Types and Operators by (32.9k points)
closed by
Name Jose
Roll no  20
Age 17
Weight 46.650

Consider the above data, we know that there are different types of data are used in the computer. Explain different data types used in C++.

1 Answer

+1 vote
by (30.7k points)
selected by
 
Best answer

i) int data type: It is used to store whole numbers without fractional (decimal point) part. It can be either negative or positive. It consumes 4 bytes (32 bits) of memory. i.e. 232 numbers. That is 231 negative numbers and 231 positive numbers (0 is considered as +ve) So a total of 232 numbers. We can store a number in between -231 to + 2311.

ii) char data type: Any symbol from the key board, 

eg; ’A’.,’?’, ‘9’,…. It consumes one byte( 8 bits) of memory. It is internally treated as integers, i.e. 28 = 256 characters. Each character is having a ASCII code, ‘a’ is having ASCII code 97 and zero is having ASCII code 48.

iii) float data type: It is used to store real numbers i.e. the numbers with decimal point. It uses 4 bytes(32 bit?) of memory. 

Eg. 67.89,89.9 E-15. 

iv) double data type: It is used to store very large real numbers. It uses 8 bytes(64 bits) of memory. 

v) void data type : void means nothing. It is used to represent a function returns nothing.

Welcome to Sarthaks eConnect: A unique platform where students can interact with teachers/experts/students to get solutions to their queries. Students (upto class 10+2) preparing for All Government Exams, CBSE Board Exam, ICSE Board Exam, State Board Exam, JEE (Mains+Advance) and NEET can ask questions from any subject and get quick answers by subject teachers/ experts/mentors/students.

...