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
Your motherboard supports dual channeling and you currently have two slots populated with DIMMs; each module holds 2 GB. You wan
Olenka [21]
One 4-GB DIMM. Dont really have a explanation for it just comes from previous experience
6 0
4 years ago
Read 2 more answers
What is NOT type of network?
Serjik [45]

Answer:

hope this helps good luck

need more answers follow me

Explanation:

Answer = c. Explanation:The Types of Computer Networks are LAN, MAN, PAN, WAN, CAN but RAN Remote Area Network is not a type of CN

3 0
3 years ago
Write the name of test for the given scenario. Justify your answer.
Snowcat [4.5K]

Answer:

Cevap b okey xx

Explanation:

Sinyorrr

8 0
3 years ago
which student organization helps students with career development by having them become interms to sponsor conferences?
Alex73 [517]

Answer:

Student Government

Explanation:

7 0
3 years ago
The World Wide Web is full of unstructured data. Search engines like Google, Bing and Yahoo have been doing a good job of allowi
bija089 [108]

Answer: Query

Explanation:

The Search Criteria is entered and any when a related Query is logged, it speedily bring out the linked details for exploration.

5 0
4 years ago
Other questions:
  • The icons to insert pictures and clip art in the PowerPoint application are located in the _____ grouping on the Insert tab.
    7·1 answer
  • 1)A popular and useful tool for strategic planning is SWOT analysis. SWOT stands for
    6·1 answer
  • Describe a function that would take in any RGB value and double its intensity. What do you think happens if the input is 200, 22
    8·1 answer
  • If a simple pipelined processor is super-pipelined by a factor of 3 (the ALU takes 3 cycles instead of one for the smallest oper
    15·1 answer
  • What component of a processor handles all logical comparisons and calculations inside the processor?
    9·1 answer
  • (10 points) A stopwatch has three states named Zero, Running, and Stopped. There are two buttons, named B1 and B2. For each butt
    13·1 answer
  • I NEED HELP ASAP:
    8·1 answer
  • You should avoid “S” curves in your photographs. True or False?
    11·1 answer
  • Select the device that will have the most network ports
    8·1 answer
  • What does Technology mean to you?​
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!