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
HAY ALGUEN QUE ASE PARN4 CON UN PUTO ÑIÑO
tamaranim1 [39]
Hshahbwhwjqqjkqjajwkkw
6 0
3 years ago
V to "mutual funds"?
Anettt [7]

Answer:

D. All of the above.

Explanation:

The mutual funds can be affected by the market condition, and the investor's investment can be lost. It does not provide any assurance or any guarantee that the scheme targets or the goals are going to be achieved or will not be achieved. The investment of the fund is done later, and businesses are picked up according to the wishes of the investor who creates the pool.

And they can be a smart investment for young people, and they do contain the combination of various types of stocks. And they are commonly found in the retirement accounts. Hence, all of the above points are true about mutual funds.

3 0
3 years ago
Who created Microsoft​
saveliy_v [14]

Bill Gates and Paul Allen

6 0
3 years ago
Read 2 more answers
Unicode is a world standard to represent _________________
horsena [70]

Answer:

characters.

Explanation:

We need to represent characters in binary format so that they can be stored in computer memory. Earlier, ASCII (American Standard Code for Information Interchange) representation was commonly used for english characters. But ASCII was found to be insufficient for representing multilingual and special characters.Unicode character representation was developed to overcome this limitation.

8 0
3 years ago
Which of the following is considered proper ergonomics?
dexar [7]

Answer:

The First One

Explanation:

because ergonomics is trying to make the person who is using the device be in a more natural position. Raising the keyboard will make the typer feel more comfortable.

5 0
3 years ago
Read 2 more answers
Other questions:
  • A boolean variable named rsvp an int variable named selection, where 1 represents "beef", 2 represents "chicken", 3 represents "
    14·1 answer
  • When computers connect to one another to share information, but are not dependent on each other to work, they are connected thro
    14·2 answers
  • Which two sentences uses the colon correctly?
    13·1 answer
  • Derek is working at the help desk when he receives a call from a client about an issue with the company's email. The customer is
    9·1 answer
  • Suppose that we have a set of activities to schedule among a large number of lecture halls, where any activity can take place in
    12·1 answer
  • . Some countries lack physical resources, like computers or network connections, making it difficult to keep up with the technol
    8·2 answers
  • You are hired to train a group of new users to become technicians. One of your lessons is on how to construct Cat5 and Cat6 Ethe
    10·1 answer
  • Ms. Osteen gives her class an assignment to insert background color that gradually changes from blue to green. To accomplish thi
    8·1 answer
  • The 0-1 knapsack problem is the following. A thief robbing a store finds n items. The ith item is worth vi dollars and weighs wi
    14·1 answer
  • Jim is working on a network design for a small office running a Windows file and printer server with Internet
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!