New course! Every coder should learn Generative AI!
Try a free lesson0
What is the size of int data type?(according to me it is 2 but here it is showing 4)
4 Answers
+ 3
Tanish Gabbar It's depends on plateform.
Check in Java here 4 bytes given
https://cs-fundamentals.com/java-programming/java-primitive-data-types.php
In C given 2 bytes.
https://intellipaat.com/blog/tutorial/c-tutorial/c-data-types/
In C++ 4 bytes given
https://www.google.com/amp/s/www.geeksforgeeks.org/c-data-types/amp/
+ 1
Here it is showing 4 so should i follow this??
- 1
2 bytes on 16 bit machine
4 bytes on 32 and
8 bytes on 64.