0% found this document useful (0 votes)
34 views

Data Types: What Are These?

This document discusses data types in programming. It explains that data types define rules for how data is stored in memory and what operations can be performed on that data. For example, the data type 'int' refers to a signed 32-bit integer that can be used for mathematical operations but not string operations. Data types help ensure the right type of data is stored and allow the CPU to understand how to process that data.

Uploaded by

Foyzul Karim
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views

Data Types: What Are These?

This document discusses data types in programming. It explains that data types define rules for how data is stored in memory and what operations can be performed on that data. For example, the data type 'int' refers to a signed 32-bit integer that can be used for mathematical operations but not string operations. Data types help ensure the right type of data is stored and allow the CPU to understand how to process that data.

Uploaded by

Foyzul Karim
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Foysal on Basic Programming

[email protected]

Data Types

what are these?


how the CPU works?

it just executes 1s and 0s


we instruct the machine 
the instructions turned into 1s and 0s by
compilers
Whats the difference between the
two?

"100" and 100


Answer the questions

"100"+"100" = ? 100+100=?
"100"+1=? 100+1=?
Length of "100" = ? Length of 100 = ?
Memory need for "100" = Memory need for 100 = ?
?
So, we can conclude that its not possible to answer each
of the questions mentioned above.

But why is that so?


Actually we set some rules
for the data and assigning a
specific amount of memory
to store that in memory. The
data follows the rules
defined for it and perform
some predefined operations
Yes. ladies and gentlemen..

These different rules are


called DATA TYPES
So, in C#, the data type 'int' means

The int keyword denotes an integral type that stores values (source)
Its size is Signed 32-bit
Its range is -2,147,483,648 to 2,147,483,647
we can perform mathematical operations such as Addition, Subtraction etc on this type
however, we can't perform concatenation, remove space etc operations on this type of data

If you look more closely, the mentioned are


the rules and allowed operations for 'int'
data type.

You might also like