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
mixas84 [53]
4 years ago
11

Write a program to determine the addresses of memory locations allocated to various variables as follow:

Computers and Technology
1 answer:
Andreas93 [3]4 years ago
5 0

Here you go,

PROGRAM


#include<stdio.h>

#include<stdlib.h>

int main()

{

   short int a,b;

   int c,d;

   long int e,f;

   short int size_short,size_int,size_long_int;

//printing address of variable using void pointer

   printf("\nAddress of first short int variable : %p", (void*)&a);

   printf("\nAddress of second short int variable : %p", (void*)&b);

   printf("\n\nAddress of first int variable : %p", (void*)&c);

   printf("\nAddress of second int variable : %p", (void*)&d);

   printf("\n\nAddress of first long int variable : %p", (void*)&e);

   printf("\nAddress of second long int variable : %p", (void*)&f);

   //calculating size by subtracting memory address

   size_short = (short int)((void*)&a - (void*)&b);

   size_int = (short int)((void*)&c - (void*)&d);

   size_long_int = (short int)((void*)&e - (void*)&f);

   printf("\n\nsize of short variable by subtracting address : %u", size_short);

   printf("\n size of short variable by using sizeof() : %u", sizeof(a));

   printf("\n\nsize of int variable by subtracting address : %u", size_int);

   printf("\n size of int variable by using sizeof() : %u", sizeof(c));

   printf("\n\nsize of long int variable by subtracting address : %u", size_long_int);

   printf("\n size of long variable by using sizeof() : %u", sizeof(e));

   return 0;

}

You might be interested in
Which statement about intellectual property is true? (CSI-7.6) Group of answer choices It is okay to use code you find on the in
nika2105 [10]

Answer:

Laws are in place to cover your creative work, which includes code you have written.

Explanation:

Copyright law can be defined as a set of formal rules granted by a government to protect an intellectual property by giving the owner an exclusive right to use while preventing any unauthorized access, use or duplication by others.

A copyright can be defined as an exclusive legal right granted to the owner of a creative work (intellectual property) to perform, print, record, and publish his or her work. Also, the owner is granted the sole right to authorize any other person to use the creative work.

For instance, copyright law which protects the sharing and downloading rights of music is known as the Digital Millennium Copyright Act (DMCA).

An intellectual property can be defined as an intangible and innovative creation of the mind that solely depends on human intellect.

Simply stated, an intellectual property is an intangible creation of the human mind, ideas, thoughts or intelligence. They include intellectual and artistic creations such as name, symbol, literary work, songs, graphic design, computer codes, inventions, etc.

Hence, laws are in place to cover a person's creative work, and it includes code he or she have written.

6 0
3 years ago
How do you add Rulers to a document?: *
swat32

Answer:

a. click on View, then ruler

Explanation:

If you want to add ruler to the document following is the procedure to do it:

Click on View.

Then check the ruler in the group called show.

You will get the ruler in your document.You can also remove it by unchecking the ruler box.

Ruler is used to measure and line up objects.

Hence the answer to this question is option A.

4 0
3 years ago
You are tasked with securing a small network for a client in which the following requirements must be met: If a user on the priv
mario62 [17]

Answer:

C

Explanation:

It is best to Implement a UTM appliance.

A Unified Threat Management (UTM) system is a type of network hardware appliance, virtual appliance or cloud service that protects businesses from security threats in a simplified way by combining and integrating multiple security services and features.

DescriptionUnified threat management is an approach to information security where a single hardware or software installation provides multiple security functions. This contrasts with the traditional method of having point solutions for each security function.

Cheers

8 0
4 years ago
Discuss about the main frame computer​
Nimfa-mama [501]

Answer:

Mainframes (also called "big iron")[1] are powerful computers used for large information processingjobs. They are mainly used by governmentinstitutions and large companies for tasks such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing. Mainframe computers are specially used as servers on the World Wide Web (WWW). They are distinct from supercomputers.

7 0
3 years ago
TRUE/FALSE: In order to use an object in a program, its class must be defined.
FinnZ [79.3K]
Yes that is correct. True
3 0
3 years ago
Other questions:
  • If reading or writing a cache line of size 64 bytes to Flash requires 2.56 μJ and DRAM requires 0.5 nJ, and if idle power consum
    9·1 answer
  • When you make a pointer variable im C++, is star label a must?
    9·1 answer
  • What is ucspi-tcp pakage in qmail??
    5·1 answer
  • You are holding a rock tied to a string, which is an example of a pendulum. identify and explain the proper term for each part o
    10·2 answers
  • Molly, an end-user, connects an external monitor, external keyboard and mouse, and a wired network cable to her laptop while wor
    5·2 answers
  • Jeremy wishes to create a site map for his website. What tag will surround the URL of his home page?
    9·1 answer
  • When you use an external style sheet with an HTML document, you get all but one of the benefits that follows. Which one is NOT a
    15·1 answer
  • I made Pico with a Ray Gun (Next is Dad/Tankman)<br><br> Opinons?
    11·2 answers
  • What is the outcome when a floating-point number is divided by zero?
    12·1 answer
  • Moving images of real event​
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!