≡ Menu

What are the advantages of data type int over data type double? What are the advantages of type double over type int

You are Here: Home > Computer Subjects > Programming in C Language > …

What are the advantages of data type int over data type double? What are the advantages of type double over type int?

Ans.
Advantages: Int over Double

  • Int occupies lesser memory than double.
  • Int data type can be used in case statements, where as doubles can’t.
  • If we assign a double value like 50.0, it will fail when compared with int value 50.
  • Int value can be transmitted across a network, however double can’t.


Advantages: Double over Int

  • Double is capable to store both whole and integer numbers, where as int can store only integer numbers.
  • Range of double is much more bigger than the int.

 

{ 0 comments… add one }

Leave a Comment