computer science

Cyborg data type sizes. You have been given a job as a programmer on a Cyborg supercomputer. In order to accomplish some calculations, you need to know how many bytes the following data types use: char, int, float, and double. You do not have any manuals, so you can’t look this information up. Write a C++ program that will determine the amount of memory used by these types and display the information on the screen.

  1. 👍 0
  2. 👎 1
  3. 👁 852
  1. // Programming Challenges of Chapter 2 on P77
    // Written by Lanchuan Chang

    #include <iostream>
    using namespace std;

    int main()
    {
    // 9. Cyborg Data Type Sizes
    cout << " the size of a char is " << sizeof(char) << " bytes.\n";
    cout << " the size of an int is " << sizeof(int) << " bytes.\n";
    cout << " the size of a float is " << sizeof(float) << " bytes.\n";
    cout << " the size of a double is " << sizeof(double) << " bytes.\n";

    return 0;

    }

    1. 👍 0
    2. 👎 0
  2. HAHAHAAHAHAHAHA

    1. 👍 0
    2. 👎 0

Respond to this Question

First Name

Your Response

Similar Questions

  1. history

    why is job specialization an important feature of civilization A. Job specialization creates social classes B. Job specialization allows for a variety of goods and services to be produced******* C. Job specialization allows the

  2. M

    In printing an article of 21,000 words, a printer decides to use two sizes of type. Using the larger type, a printed page contains 1,200 words. Using the small type, a page contains 1,500worda. The article is alloted 16 full pages

  3. AP STATISTICS

    Mens shirt sizes are determined by neck sizes. suppose the mens nexck sizes are approximatley normally distributed with mean 15.7 inches and standard deviation 0.7 inch.retailer sells men shirts in S,M,L,XL where the shirt sizes

  4. Social studies

    Which of these factors contribute to the income potential of a job? a. the education required to be successful at a job•• b. the amount of income a person wants to make at a job c. the special skills needed to do a job

  1. statistics

    The breakdown of workers in a particular state according to their political affiliation and type of job held is shown here. Suppose a worker is selected at random within the state and the worker's political affiliation and type of

  2. Social studies 7

    Which job would likely have the lowest income? A job that many people are welling to do•• A job that takes highly specialized skills A job that requires a college diploma A job that requisa lot of travel

  3. math

    Different sizes of ribbon need to be cut to go around various shapes. All of the following sizes are in inches. √3 2√3 √5 (a) Without using your calculator, approximate the decimal equivalent of each number to the nearest

  4. maths

    In printing an article of 30,000 words a printer decides to use two sizes of type. Using the larger type, a printed page contains 1,200 words. Using the smaller type, a page contains 1,500 words. The article is allotted 22 pages

  1. HR

    Which of the following approaches would be most appropriate when gathering information for jobs that are repetitive and involve physical activity? A. A job analyst visits the workplace and asks employees to show what the job

  2. Algebra 1

    Which type of function best models the data in each table? Write an equation to model the data. Table: x | y 0 | 5 1 | 2 2 | 0.8 3 | 0.32 4 | 0.128 Please help me out with this I would really appreciate it! If someone could

  3. Math

    Describe at least two ways of finding a missing side length in a pair of similar figures. This depends on what type of figure it is and what type of data you already have. Can you be more specific? Please repost with more data.

  4. Advanced algebra

    The number of freshmen entering college in a certain year is 621. What type of data is 621? A. Discrete data B. categorical data C. Continuous data

You can view more similar questions or ask a new question.