1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
xxTIMURxx [149]
3 years ago
7

write a C program the prints out the size of variables with the following C data types- int, long, unsigned, long long, double,

float, char, and double
Computers and Technology
1 answer:
Anit [1.1K]3 years ago
4 0

<u>C program for finding size of different data types</u>

#include <stdio.h>

//driver function

int main()

{

   int a;  //declaring a of type int

   float b; //declaring b of type float

   double c; //declaring c of type double

   char d; //declaring d of type char

   long e; //declaring e of type long

   long long f; //declaring f of type longlong

   unsigned g; //declaring g of type unsigned

   // Sizeof operator is used to evaluate the size of a variable

printf(" int data type contains: %lu bytes\n",sizeof(a));/*Finding size of int */

printf("float data type contains : %lu bytes\n",sizeof(b));/*Finding size of float */

printf("double data type contains: %lu bytes\n",sizeof(c));/*Finding size of double */

printf("char data type contains: %lu byte\n",sizeof(d));/*Finding size of char */

printf("long data type contains: %lu byte\n",sizeof(e));/*Finding size of long*/ printf("longlong data type contains: %lu byte\n",sizeof(f));/*Finding size of longlong */

printf("unsigned data type contains: %lu byte\n",sizeof(g)); /*Finding size of unsigned */

   return 0;

}

<u>Output</u>

int data type contains: 4 bytes

float data type contains : 4 bytes

double data type contains: 8 bytes

char data type contains: 1 byte

long data type contains: 8 byte

longlong data type contains: 8 byte

unsigned data type contains: 4 byte

You might be interested in
1. It is a requirement to install a routing protocol that monitors the network for routers that have changed their link state. T
Nady [450]

Answer:

1. Open Shortest Path First (OSPF)

2. Border Gateway Protocol (BGP)

3. Routing and Remote Access Service (RRAS)

4. Frame relay

5. Synchronous

6. Virtual

7. Committed Information Rate (CIR)

8. Integrated Services Digital Network (ISDN)

9. Asynchronous Transfer Mode (ATM)

10. Basic Rate Interface (BRI).

8 0
3 years ago
Early word processors ran on devices that look like digital
S_A_V [24]

Answer:

True

Explanation:

The word processor used to be the only office machine in the year 1960s, that combined the keyboard text-entry and various printing functions of an electric typewriter with the recording memory. And this recording unit was a tape or a floppy disk, with the simplest of processor applied for text editing. Hence, the above statement that the early word processors ran on the devices that look like digital is true.

6 0
3 years ago
Read 2 more answers
Which one of these is NOT a successful budgeting strategy?
Elina [12.6K]
Answer D isn't a successful budgeting strategy.
7 0
3 years ago
Read 2 more answers
An organization needs to maintain data files of its employees in the form of tables. They also need to access and update over th
olga nikolaevna [1]

Answer:

A

Explanation:

Database software is a software program or utility used for creating, editing and maintaining database files and records. This type of software allows users to store data in the form of structured fields, tables and columns, which can then be retrieved directly and/or through programmatic access.

7 0
2 years ago
Why wont it let me get another free trial on adobe photoshop?
k0ka [10]
A free trial is a one-time thing. Try using another email address or something. 
3 0
3 years ago
Other questions:
  • If the current through a heater coil is 5 amp and the supply voltage is 120 volts, the coil resistance is A. 0.04 ohm. B. 24 ohm
    6·1 answer
  • Libby wrote an email to her friend. She pressed Shift and the number key 2 together to enter the email address. Which symbol did
    7·2 answers
  • What is the IEEE standard for the Wi-Fi Protected Access 2 (WPA2) security protocol?
    6·1 answer
  • Suppose a worker needs to process 100 items. the time to process each item is exponentially distributed with a mean of 2 minutes
    5·1 answer
  • Place the steps in order to link and place text into the document outline, effectively creating a master document.
    8·1 answer
  • Please help!
    10·2 answers
  • Can you help please ill give branilist
    6·1 answer
  • What is the value of numX when this program is executed? if 3 &lt; 5 and 8 != 3: numX = 3 else: numX = 7
    13·2 answers
  • How do mutations affect natural selection? brain pop
    11·1 answer
  • Which of the examples is part client side code
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!