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
Some attackers might create a peer-to-peer network that connects a wireless device directly to another wireless device, such as
julia-pushkina [17]

Answer:

ad-hoc network

Explanation:

Ad-hoc network is a type of network that is setup to allow computers to talk to each other without the use of a router or server. The computers communicate directly with each other. In windows operating system ad-hoc is implemented as a communication mode which can be turned on.

4 0
3 years ago
Who completes the action item form in a team meeting
____ [38]

Answer:

Recorder

Hope this helped! I'm not 100% if this answer is correct, though

3 0
2 years ago
__________ is the order of arrangement of files and folders.
lesya692 [45]

sequence is the order of arrangement of files and folders.

6 0
4 years ago
Rest or take a break every __ minutes when typing. Please help!
Talja [164]
Maybe like 3-5 I think im right
3 0
4 years ago
Read 2 more answers
2560x1600 (apple)vs 1920x1200 (Dell), is there a big difference between those 2 based on screen resolution ? ​
Solnce55 [7]

Answer:

Yes

Explanation:

1920x1200 is a non-standard resolution which may not be fully supported, usually 1920x1080 (1080p) is preferred and has been standardised as a display resolution.

2560x1600 (WQXGA) is a more standardised display resolution, and will offer a lot sharper and crisper images as more pixels are being used to render the image. As a rule of thumb, the higher resolution - the better.

The difference between these two resolutions is about the same difference as 1080p and 2k, you are going to get twice as crisp an image.

However there are other factors, such as refresh rate that may come into play with a comparison with these two.

3 0
4 years ago
Other questions:
  • Your boss wants to utilize some sort of cloud storage for his files so that all of his
    10·2 answers
  • Thomas has decided to key an agenda for the FBLA meeting using a column format. What is recommended to guide the reader’s eye an
    15·1 answer
  • Which statement regarding socializers is true?
    10·2 answers
  • Select the correct answer from each drop-down menu.
    7·2 answers
  • The World Wide Web is a program that allows you to search for information on the Internet.
    9·1 answer
  • Give a detailed easy to understand explanation what the kerneltrapmode is. WILL AWARD BRAINLIEST!
    13·1 answer
  • How many sets of number do both Hex and RGB values have?
    10·1 answer
  • What is a registered degree
    12·1 answer
  • A web application with an SQL server database is found to be compromised by an attacker. On examination, the email IDs of the da
    5·1 answer
  • Is Using programming libraries is one way of incorporating existing code into new programs true
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!