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
When a business is using methods that help it use its time and resources the best they can, what are they exercising?
maria [59]
<span>B. Efficiency

(</span><span>effective training </span><span>techniques)</span>
3 0
3 years ago
Read 2 more answers
A ________ allows users to add, remove, or edit its content.
Amanda [17]
Wiki is the correct answer
4 0
3 years ago
Read 2 more answers
Without this step of the problem solving process you might solve the wrong problem, not know where to start, or not know when yo
STatiana [176]
Prepare should be the answer
7 0
3 years ago
Let’s say you attach four images to accompany an important tweet that you’ve composed in the Hootsuite Compose Box. On Twitter,
Damm [24]
I doub between:

<span>  C)  A series of 4 full size, but individual tweets (with the tweet copy appearing above the first image of the series)  D)  A collage format, with full size images</span>

6 0
3 years ago
Your manager has asked you to write a program that displays the percentage of males and female in your class. The program should
Blababa [14]

<u>Explanation:</u>

The program using <em>python programming language </em>would be:

First, we write the Input prompt.

<u>Input  prompt for the user</u>

number_of_males_in_class = int (input ('Enter the number of males: '))

number_of_females_in_class = int(input('Enter the number of females: '))

Next, we write the Process algorithm.

<u>Process  algorithm</u>

total_number_of_students_in_class = number_of_females_in_class + number_of_males

_in_class

percentage_of_males_in_class = number_of_males_in_class / total_number_of_students

_in_class

percentage_of_females_in_class = number_of_females / total_number_of_students

Finally, the Output process

<u>Output process</u>

print('Total number of males in class =', format(percentage_of_males_in_class, '.0%'))

print('Total number of females =', format(percentage_of_females_in_class, '.0%'))

7 0
3 years ago
Other questions:
  • What udp port is used for i k e traffic from vpn client to server?
    14·1 answer
  • You save $500 in a retirement account at age 25. it increases an average of 10% per year until you are 65. which formula and res
    13·1 answer
  • The problem of using IP numbers for addressing hosts in the Internet are resolved using
    5·1 answer
  • A(n) ____ is a request for specific data from a database.
    9·1 answer
  • How does a content management system differ from a basic wysiwyg web authoring tool??
    11·1 answer
  • Consider the following skeletal C program: void fun1(void); /* prototype */ void fun2(void); /* prototype */ void fun3(void); /*
    11·1 answer
  • Write a program that reads students’ names followed by their test scores. The program should output each student’s name followed
    13·1 answer
  • BIm computer class I need answers please
    5·2 answers
  • Help brainliest True or False
    10·2 answers
  • What are benefits of AI
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!