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
Which component is a part of the central processing unit (CPU) of a computer
suter [353]
The arithmetic logic unit (ALU), which performs arithmetic and logical operations.

The control unit (CU), which extracts instructions from memory and decodes and executes them, calling on the ALU when necessary.

6 0
3 years ago
Read 2 more answers
An instance variable name of type String, initialized to the empty String. An instance variable score of type int, initialized t
timofeeve [1]

Answer:

public class Class {

   private String name ="";

   private int score = 0;

   //Method SetName

   public void setName(String newName){

       name = newName;

   }

//Method SetScore

   public void setScore(int newScore){

       score = newScore;

   }

//Method GetName

   public String getName() {

       return name;

   }

//Method GetScore

   public int getScore() {

       return score;

   }

}

Explanation:

  • The class called Class is implemented in Java programming language
  • It has two fields (instance variables name and score)
  • Methods for setting the values of variables (mutator methods) or setters
  • Methods for getting the values of the variables (accessor methods) getters
8 0
3 years ago
Which of the following devices are least likely to deny a connection inline when an attack is detected? (select 2)
user100 [1]

Answer: Option (A) & (D) are correct.

Layer 2 switch is commonly referred to as a type of network or device switch that tends to work on data link layer and use MAC addresses in order to determine the route through which the frames are forwarded.

An IDS known as intrusion detection system is commonly referred to as a device or application that controls a network for malevolent activity and its policy violations.

7 0
2 years ago
Most of the Desktop games contain a backdoor used to test and update the game.
sveta [45]

A backdoor is a typically covert method of bypassing normal authentication or encryption in a computer, product, embedded device (e.g. a home router), or its embodiment (e.g. part of a cryptosystem, algorithm, chipset, or even a "homunculus computer" —a tiny computer-within-a-computer such as that found in Intel's AMT technology).Backdoors are most often used for securing remote access to a computer, or obtaining access to plaintext in cryptographic systems. From there it may be used to gain access to privileged information like passwords, corrupt or delete data on hard drives, or transfer information within autoschediastic networks.

the answer is True

i hope it will help you

8 0
3 years ago
Which graphics format works best for desktop publishing and print work? (1 point) .tiff .gif .tga .jpeg?
Sergeeva-Olga [200]
. jpeg, probably works best
6 0
2 years ago
Other questions:
  • Which of the following translates packets so that the node can understand them once they enter through a port?
    8·2 answers
  • What is a Boolean Expression?
    12·1 answer
  • Variable names may contain spaces and punctuation symbols. True False
    15·1 answer
  • why is it important to use a general search engine, like GOOGLE, to look up the name of the organization, institution, agency or
    7·1 answer
  • Which of the following is an example of new and emerging classes of software?
    11·1 answer
  • Drag the tiles to the correct boxes to complete the pairs.
    6·1 answer
  • A computer's hard disk drive holds 8 x 10^10 bytes of information. If Jill buys an extra memory stick that holds 5.1 X 10^8 byte
    10·1 answer
  • It is important to know the terms of use of any website because why
    12·2 answers
  • An attacker gained remote access to a user's computer by exploiting a vulnerability in a piece of software on the device. The at
    14·1 answer
  • ____ Is an Internet service that allows users to send and receive short text messages In real time.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!