Question

Suppose that account identification numbers are written using nine digits, for example, 972-54-5990. What C variable...

Suppose that account identification numbers are written using nine digits, for example, 972-54-5990. What C variable type should be used to store these? Why?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

we can use "int" or "unsigned int" or "long" data type because range of integer lies between -2,147,483,648 to 2,147,483,647.

size of data types depend on compiler which one you are using. If OS is 32 bit or 64 bit then it will take 4 bytes and if OS is 16 bit then size will be 2 bytes.

int            2 or 4 bytes   -32,768 to 32,767 or-2,147,483,648 to 2,147,483,647
unsigned int    2 or 4 bytes    0 to 65,535 or 0 to 4,294,967,295
long             4 bytes        -2,147,483,648 to 2,147,483,647
unsigned long    4 bytes    0 to 4,294,967,295

So use any of above data types for storing 9 digits number.

Add a comment
Know the answer?
Add Answer to:
Suppose that account identification numbers are written using nine digits, for example, 972-54-5990. What C variable...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Suppose we want to form three-digit numbers using the set of digits (0,1,2,3,4,5). For example, 301...

    Suppose we want to form three-digit numbers using the set of digits (0,1,2,3,4,5). For example, 301 and 223 are such numbers, but 037 is not. How many such numbers are possible? There are three-digit numbers formed by using the digits {0,1,2,3,4,5).

  • Introduction: Ten digit ISBN numbers are created so that the first nine digits are information digits...

    Introduction: Ten digit ISBN numbers are created so that the first nine digits are information digits and the last digit is a check digit. T his last number helps people notice and correct mistakes that might be made in recording the information digits. The same is true for thirteen digit ISBN numbers. Here is a ten digit ISBN number: 0-13-149498-8. The digit 0 indicates the book is written for English-speaking people. The number 13 and the number 149498 identify the...

  • using the following pseudocode what C++ data types should be used for the variable "finalAmount" //...

    using the following pseudocode what C++ data types should be used for the variable "finalAmount" // Start Declarations num amount num newAmount num interestRate output "Please enter the dollar amount. // input amount output "Please enter the interest rate (e.g., nine percet should be entered as 9.0). // input interestRate newAmount FutureValue (amount, interestRate) // output "The new dollar amount is ", newAmount // Stop 17 num FutureValue (num initialAmount, num interestRate) Declarations num finalAmount finalAmount = (1 + interestRate/100)...

  • Using C# to build this program   Digits of an Integer (Project Name: DigitParser) - Write an...

    Using C# to build this program   Digits of an Integer (Project Name: DigitParser) - Write an app that inputs one number consisting of five digits from the user, separates the number into its individual digits and displays the digits separated from one another by three spaces each. For example, if the user types 42339, the app should display 4 2 3 3 9 Assume that the user enters the correct number of digits. What happens when you execute the app...

  • using c# visual studio 3.28 (Digits of an Integer) Write an app that inputs one number...

    using c# visual studio 3.28 (Digits of an Integer) Write an app that inputs one number consisting of five digits from the user, separates the number into its individual digits and displays the digits separated from one another by three spaces each. For example, if the user types 42339, the app should display 4 2 3 3 9 Assume that the user enters the correct number of digits. What happens when you execute the app and type a number with...

  • This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to...

    This C++ Programs should be written in Visual studio 2017 PROGRAM 1: Comparing Using Arrays to Using Individual Variables One of the main advantages of using arrays instead of individual variables to store values is that the program code becomes much smaller. Write two versions of a program, one using arrays to hold the input values, and one using individual variables to hold the input values. The programs should ask the user to enter 10 integer values, and then it...

  • c++ I am suppose to write a function that gets a number from a user, say...

    c++ I am suppose to write a function that gets a number from a user, say 3.123456789 and then the program gets another number from the user which is used to find out how many decimal digits we want rounded to. So if the user inputs 3 then the number would turn into 3.123 then we are suppose to add two digits next to the rounded number so it would turn into 3.12300. the rounding is suppose to be done...

  • Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to ...

    Using C++ Design a class called Numbers that can be used to translate integers in the range 0 to 9999 into an English description of the number. The class should have a single integer member variable: int number; and a static array of string objects that specify how to translate the number into the desired format. For example, you might use static string arrays such as: string lessThan20[20] = {"zero", "one", ..., "eighteen", "nineteen"}; string hundred = "hundred"; string thousand...

  • This is programming project 1 chapter 9(Book ISBN:1292222824 (1-292-22282-4) Walter Savitch Problem Solving with C++: Global...

    This is programming project 1 chapter 9(Book ISBN:1292222824 (1-292-22282-4) Walter Savitch Problem Solving with C++: Global Edition, 10/E) Question Do Programming Project 7 in Chapter 7 using a dynamic array. In this version of the problem, use dynamic arrays to store the ditits in each large integer. Allow an arbitrary number of digits instead of capping the number of digits at 20. TER 7/ Arrays time. For example digit at a the integer 1234 could be stored in the array...

  • Prime Number Programing in C Note: The program is to be written using the bitwise operation....

    Prime Number Programing in C Note: The program is to be written using the bitwise operation. Use an integer array (not a Boolean array) and a bit length (for instance 32 bits). In this program you will write a C program to find all prime numbers less than 10,000. You should use 10,000 bits to correspond to the 10,000 integers under test. You should initially turn all bits on (off) and when a number is found that is not prime,...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT