Question : Here How One Should Decide Which Data Type of Integer we should use in order fulfill our requirement ?
Answer :

  1. Integer Data Can be Divided can be used up to great extend depending upon application.
  2. Char can hold values up to 127
  3. Short int and int can hold values up to 32,767
  4. Long int can hold values up to 2,147,483,647. 
How to Decide ?
  1. Consider Problem Statement and Then imagine which Variables we are using in the program.
  2. Decide Scope of the Variable and the probable use of Variable.
  3. Example : Suppose we are using a Counter that will count 10 numbers then short int is sufficient to store data .
  4. But if we are writing program that will accept 4-Digit number then we should use integer or long integer depending upon Range.
SIZE(char) <= SIZE(short) <= SIZE(int) <= SIZE(long)


Tags / Keywords : | , , , , , , , ,

0 comments

Post a Comment

Your Feedback :This is Growing Site and Your Feedback is important for Us to improve the Site performance & Quality of Content.Feel Free to contact and Please Provide Name & Contact Email