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
Olivia needs to get permission to use a graph of data gathered by a trade association she plans to include the graph in a report
balandron [24]

Answer: by reading the copyright notice on the website where she found the graph.

Explanation: ~Apex~

3 0
3 years ago
Read 2 more answers
The ________ contains the central electronic components of the computer. select one:
Sati [7]
The motherboard contains the central electronic components of the computer.
6 0
3 years ago
Super easy question but you have to think about it because it’s not that easy I’ll mark brainliest for first answer Explain the
kkurt [141]

Answer:

Databases are not that simple. Now we not only have a Data warehouse, but we also have the Data Lake as well. We also have NoSQL and SQL form of support with these modern databases. The JSON format is rocking. You can hence through JSON store the text, image, audio, video, etc in one go. And like the first five can be a text, the next five can be an image then again a text than video, and so on. And it is super easy to access them as well. Also, you can edit them quite easily as well. It's not that hard like the Lisp used to be in the past. And supermarket has a mix blend of the database. And modern databases like Data Lake can be very useful, undoubtedly.

You can store security type of requirements, like CCTV footage, each shop details like shop ID, Product list, shop type, electricity bill, hours of opening, floor, facilities, no. of employees, etc., and like this, we can have the details for the entire supermarket, and each shop there definitely. And we can perform various actions on behalf of each shop and market as well. The database can hence be very useful definitely

Explanation:

Please check the answer.

8 0
3 years ago
2-Write test programs in java to determine the scope of a variable declared in a for statement. Specifically, the code must dete
ankoles [38]

Answer:

See Explaination

Explanation:

public class testscope

{

//start of main function

public static void main(String[] args)

{

//varible declration

int i;

int x;

//loop for 10 times

for(i=0; i<10; i++)

{

//initialize value of x to 10

x = 10;

}

//the scope of variable x is visible outside of for loop

System.out.println("The value of x is: "+x);

}

}

See attachment for sample output

nb:

You can clearly see in the output of Java program the value of x is not printed and program return errors. It means the variable x declared inside for loop does not has scope outside the for loop.

7 0
3 years ago
What are the basic tasks performed by an operating system?​
Kruka [31]

Answer:

An operating system is a software which performs all the basic tasks like file management, memory management, process management, handling input and output, and controlling peripheral devices such as disk drives and printers.

Explanation:

i hope it helps:)

3 0
2 years ago
Other questions:
  • Use cases can be used to document both the current (As-Is) system and the future (To-Be) system. A. True B. False
    13·1 answer
  • Suppose that sum is an int variable. The statement sum += 7; is equivalent to the statement sum = sum + 7;
    7·1 answer
  • In this story, the reader is strongly encouraged to believe that Skidmore is guilty of poisoning his brother Manchester. Explain
    6·1 answer
  • Ziffcorp, an it firm, uses a technology that automatically updates the antivirus software in all the computers in the firm whene
    13·1 answer
  • O novo funcionário da equipe de desenvolvimento de sistemas está aprendendo os termos mais utilizados no dia a dia da empresa. A
    7·1 answer
  • The advent of optical discs was made possible by developments in ____ technology.
    5·1 answer
  • Television, radio, newspapers, magazines, the Internet, and other forms of communication are collectively referred to as thea. W
    15·1 answer
  • What is data Communications​
    11·2 answers
  • You are moving to an area where DSL will be available in the next six months. Which method of internet connectivity should you i
    13·1 answer
  • Which of the following could be part of an algorithm?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!