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
Anyone wanna hop on 1v1.lol<br> party code : usfhb6
hjlf

Answer:

thx for the points

Explanation:

8 0
3 years ago
Read 2 more answers
3. What do you need to do before you can sort and filter data in a database?
Digiron [165]

3. format the table

4. idk

5 0
3 years ago
Frrrrrrrrrrreeeeeeeeee brainliest for u
sukhopar [10]

Answer:

Yay I want brainliest

Explanation:

5 0
3 years ago
Read 2 more answers
Help please and thank you :)
Fynjy0 [20]
Answer:First one net is the answer ........
5 0
3 years ago
If you were working in a library and had to arrange books from a sorted book discard pile to the sorted books on the shelf in pr
sweet-ann [11.9K]
Answer: Intersection sort
6 0
2 years ago
Other questions:
  • Describe a strategy for avoiding nested conditionals. Give your own example of a nested conditional that can be modified to beco
    15·1 answer
  • What is labor and how does it relate to automobile!!!! NEED HELP PLEASEE
    13·1 answer
  • Some touch screens recognize when you touch the screen with two fingers or two hands. If you are looking for a device on which y
    11·1 answer
  • A __________ is when the sender cryptographically marks a message with its private key, which is achieved by a cryptographic alg
    12·1 answer
  • The router is physically located in a server room that requires an ID card to gain access. You've backed up the router configura
    8·1 answer
  • Write a program with class name Digits that prompts the user to input a positive integer and then outputs the number reversed an
    6·1 answer
  • Which is the best software application to be used by a hotel manager​
    9·1 answer
  • Input header here<br>input paragraph 1 here
    11·1 answer
  • If anyone can help me and get this correct I will literally venmo you and give brainliest
    5·1 answer
  • Please help me answer this question
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!