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 the advantage of defining a target user?
spayn [35]
3) helps the designer develop a website tailored to the desired audience
4 0
3 years ago
A diagram of a ten-node network that uses ten routers
tiny-mole [99]

The diagram of the of a ten-node network that uses ten routers is given in the image attached.

<h3>What is a node in a network?</h3>

A network node is known to be be seen as the kind of connection point that is seen amidst some network devices such as routers, printers, etc.

Note that they are known to often receive and send data from one network or endpoint to another.

Therefore, The diagram of the of a ten-node network that uses ten routers is given in the image attached.

Learn more about routers from

brainly.com/question/24812743

#SPJ1

3 0
2 years ago
Which is a monthly cost associated with renting a house?
Evgesh-ka [11]
The answer is a. utility bills
8 0
3 years ago
Read 2 more answers
An effective team would never have​
MA_775_DIABLO [31]

Answer:

problems or struggles

Explanation:

i believe this because with an effective team most problems aren't there and you can understand and work out problems or struggles

4 0
3 years ago
Write a C++ function for the following:
Nana76 [90]

Solution :

class Account

$ \{ $

public:

$\text{Account}()$;

double $\text{getBalance}$();

void $\text{setBalance}$();

$\text{bool withdraw}$(double bal);

$\text{private}:$

double $\text{balance}$;

}:

$\text{Account}()$ {}

double $\text{getBalance}$()

$ \{ $

$\text{return balance}$;

}

void $\text{setBalance}$(double $\text{balance}$)

$ \{ $

this.$\text{balance}$ = $\text{balance}$;

}

$\text{boolean}$ withdraw($\text{double bal}$)

$ \{ $

if($\text{balance}$ >= bal)

$ \{ $

$\text{balance}$ = $\text{balance}$ - bal;

$\text{return}$ true;

}

$\text{return}$ false;

}

}

4 0
2 years ago
Other questions:
  • According to the article in WikiAnswers, digital communication systems have more benefits than analog systems. They are faster a
    10·2 answers
  • • What is the difference between primary storage, secondary storage, and off-line storage
    10·1 answer
  • Technology has proliferated in Kenya and Somaliland, with text messages used to replace cash, creating mobile money use that, on
    11·1 answer
  • A popular database software program called ____ offers a wizard and QBE tool to help build and generate SQL queries
    9·1 answer
  • What keyboard functions lets you delete words
    15·2 answers
  • Why computer literacy is vital to access in business work
    7·1 answer
  • How do you remove management from your chrome book [administrator]
    12·1 answer
  • Which are examples of basic text structures? Check all that apply.
    8·2 answers
  • (C) Describe about the different types of computer<br> peripherals and memory devices.
    9·1 answer
  • 1.1 give five (5) reasons why modeling is an important part of system analysis and design
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!