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
What is a spreadsheet​
Delicious77 [7]
A spreadsheet function that indicates the average of a group of numbers in a range.
8 0
3 years ago
What is analog computer? where is it used​
hichkok12 [17]

Explanation:

analogue computer is in computer which is used to process analogue data.

Analogue computer were widely used in scientific and industrial application

3 0
2 years ago
Read 2 more answers
Chad, a computer programming student, just finished writing a computer program. In order to check whether the program performs t
dangina [55]
He'd need to use a compiler. 
3 0
3 years ago
Read 2 more answers
Create and apply a CSS class named YellowBackground that selects a yellow background. Apply the class to your HTML file’s body t
RSB [31]

<!DOCTYPE html>

<html>

<head>

 <title>Page Title</title>

</head>

<body class="YellowBackground">

 <style>

    .YellowBackground {

        background-color:yellow;

    }

</style>

</body>

</html>


Like this?

7 0
3 years ago
How do I convert a number into a percentage in excel
Annette [7]

format>number>percent

Explanation:

You click the box you want to convert into a percentage and then at the top where it says file, edit, view, insert, format, data, tools, add-ons and help, click format then number and then percent. This should convert your number into a percentage.

8 0
3 years ago
Other questions:
  • What is the synonym for term port?
    9·1 answer
  • Select the correct answer.
    7·2 answers
  • Elizabeth types in the following search terms: "Adoption AND cats AND NOT Persians." what results will her search provide?
    12·2 answers
  • Hat are three machines or devices that depend on gravity to work?
    5·1 answer
  • We combine the three binary bits 1, 0, and 1 to form 101 in order to represent the number 5. What does the leftmost 1 in 101 mea
    15·1 answer
  • Will mark brainliest! What does this code do? What kind of code is this called?
    15·1 answer
  • A student will not be allowed to sit in exam if his/her attendance is less than 75% .
    8·1 answer
  • In C++, objects instantiated on the stack must be returned to program memory through the explicit use of the delete keyword.
    6·1 answer
  • PYTHON
    5·1 answer
  • Three types of query​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!