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]
2 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]2 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
Part of the central processing unit
AveGali [126]

Answer:

Explanation:

The arithmetic logic unit (ALU) performs mathematical, logical, and decision operations.  It can be divided into the arithmetic unit (responsible for addition, subtraction, multiplication and division).  And logic unit (responsible for comparing, selecting, matching and merging different data or information).  The power and efficiency of the CPU depends on the design of the ALU.  

Next up is the control unit (CU) which directs all the processor’s operations.  It’s where the CPU reads and interprets requests from memory and transforms them into a series of signals (binary).  Then it sends the operation to various parts of the laptop as instructed.  The CU calls the ALU to perform the necessary calculations.  It also coordinates all input/output devices to transfer or receive instructions.

The main job of the memory unit is to store data or instructions and intermediate results.  It’s divided into primary memory and secondary memory to supply data to other units of the CPU.  It allows the CPU to perform functions requested by programs like the operating system without having to ask RAM.

Another element of the CPU not depicted in the diagram is transistors.  To carry out calculations, binary information (ones and zeros) is stored in these microscopic switches.  They control the flow of electricity depending on whether the switch is ON or OFF.  Signals turn off and on different combinations of transistors to perform calculations.  A very thin silicon chip can contain several hundred million transistors.

8 0
2 years ago
To differentiate the absolute pathnames to files that are located on different drives, html requires you to include the drive le
Ber [7]
<span>To differentiate the absolute pathnames to files that are located on different drives, HTML requires you to include the drive letter followed by a </span>vertical bar.
4 0
3 years ago
Why crt and plasma are not used in laptop ?​
AlekseyPX

Answer:

Plasma monitors are power hungry devices 2 - 3 times more than a CRT monitor making this technology unfit for use in portable devices like laptop computers where batteries are used as the power source. Plasma monitors are extremely susceptible to screen burn.

Explanation: pls mark my answer as brainlist

6 0
2 years ago
7.6 lesson practice edhesive
grigory [225]
There is a equal amount I guess free points for me
5 0
2 years ago
Read 2 more answers
When entering numbers that start with a zero, apply the _____ number format.
yuradex [85]

Answer:

The Answer is gonna be D. Zero decimal

3 0
2 years ago
Other questions:
  • Create a function average_temp(s) that accepts a file name s that contains temperature readings. Each line in the file contains
    15·1 answer
  • This type of connection uses radio waves to connect devices on a network.
    15·2 answers
  • Laura is confused with the spelling of the word pronunciation. She types the word pronunciation. Which feature of the auto corre
    8·2 answers
  • The action in which a router divides and forwards incoming or outbound message traffic to multiple links is known as
    15·1 answer
  • Fact about energy that will make a knex car move
    7·2 answers
  • Gigantic Life Insurance is organized as a single domain. The network manager is concerned that dividing into multiple domains to
    15·1 answer
  • D. What is the work of the following features:<br>1. Foot note​
    10·1 answer
  • Which software programs should students avoid using to create and submit course work? (Choose all that apply).
    6·1 answer
  • Which memory can be removed from motherboard? RAM OR ROM?​
    11·1 answer
  • when you sent email your email can be set to automatically keep a copy where do you find these copies​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!