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
you are working on creating a business document with two other co-workers. Based on just information, which of the following pre
kipiarov [429]
Brainstorming, Rationalizing, and Rough Drafts.
8 0
3 years ago
PLEASE HELP ME ON THIS what is the slide sorter used f or? A. viewing presentation notes B. editing the slide content C. changin
Oduvanchick [21]
I use PowerPoint a lot and C would be correct
7 0
3 years ago
The research conducted by Gretta's Garden suggests that besides being able to afford plants for their homes and gardens, the onl
lisov135 [29]

Answer:

Network TV.

Explanation:

Network TV is the best option in this scenario because it is more appealing as compared to other media and people have shown more interest in this media.

7 0
3 years ago
How you move the selection to a specific range by its name
natali 33 [55]

Explanation:

.Jóîn) __ ""(stw-aijd-bha)""__ 6x 10-1'coulomb or one unit. The ratio, mass for each of the particle is 9.58 x 10" per gram. Hence, the mass of each of this 797 1.6x 10-19 = 1.67X 1024 9.58 x 10 c/m Properties of all

6 0
3 years ago
This is my new horrible subject lol
Gre4nikov [31]
It's b...............
6 0
3 years ago
Other questions:
  • How do you do these questions? The first two questions could have multiple answers and the third is one answer only.
    7·1 answer
  • A blank is a link on a web page that leads to another web page.
    14·1 answer
  • "explain why professional software is not just the programs that are developed for a customer"
    7·1 answer
  • In the accompanying figure, the split double arrow mouse pointer____.
    7·1 answer
  • How long Will it take me to master scada and plc programming?​
    9·1 answer
  • Manuel has set up his network so that some employees can open and view files but are unable to edit them. Others can open, view,
    10·1 answer
  • Identify and define the various systems used in creating the Technological Systems.
    15·1 answer
  • According to a case study in one of our weekly chapter reading, nearly..................... percent of all employees send work e
    11·2 answers
  • 2y/3 - y-1/6 + 7y-1/4 = 2 1/6​
    5·1 answer
  • What is the most important person and why
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!