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
Tamera was responding to a complaint that one of the employees is having problems with the wired network connection on their lap
WARRIOR [948]

Answer:

tamera like from sister sister hehe

Explanation:

sorry i dont know the awnser

3 0
3 years ago
(2-2) In relatives.pl file, write and add the following rule. ancestor(X, Y) : X is an ancestor of Y Run ancestor(brown, X). Sub
alukav5142 [94]

Answer:

Check the explanation

Explanation:

relatives.pl

/* Facts */

male(ace).

male(john).

male(jack).

male(bill).

male(david).

male(brown).

male(daniel).

female(cecil).

female(aba).

female(cathy).

parent(john,ace)

parent(tom,john)

parent(jack,john)

parent(bill,aba)

parent(brown,aba)

parent(cecil,bill)

parent(david,cecil)

parent(cathy,brown)

parent(daniel,cathy)

parent(ellen,daniel)

/* parent(X,Y) -> Y is parent of X */

wife(ceceil,jack) /* wife(X,Y) -> Y is wife of X */

Answer of 2-2

Considering all facts and rules answer will be daniel,ellen.

Answer 2-3

Considering all facts and rules answer will be bill.

Answer 2-4

Considering all facts and rules X will be john and y will be cecil.

Answer 2-5

Considering all facts and rules X will be tom and y will be david.

4 0
4 years ago
what is internet ?? mention five ways one can use the internet profitably. state five disadvantages of the internet.​
rosijanka [135]

The Internet can be best described as network of networks since it connects over 50 million computer worldwide.

3 0
3 years ago
Read the following scenario:
Fofino [41]

Answer:

I think it is the second answer choice honestly

Explanation:

I'm gonna say either the first one or second one because the word film has something to with behind the scenes work not being an actor.

8 0
3 years ago
Read 2 more answers
Which of the following problems is least likely to be solved through grid computing? Financial risk modeling Gene analysis Linea
gregori [183]

Answer:

Linear problems

Explanation:Grid computing is the term used in Information technology, Computer programming and Computer networks to describe the interconnection of different Computer resources in order to achieve certain specified goal. GRID COMPUTING ALLOWS COMPUTER RESOURCES TO WOK AS A SINGLE UNIT.

Grid computing can be used to solve various issues connected with the use of Computer resources such as Financial risk modelling,Gene analysis etc but least likely to be used to solve Linear problems.

6 0
3 years ago
Other questions:
  • What are the links between the operating systems, the software, and hardware components in the network, firewall, and IDS that m
    7·1 answer
  • How would a programming language that allows programs to run on any operating system be classified?
    11·1 answer
  • Which type of natural hazard is sometimes caused by human activity?
    6·1 answer
  • What can Marla enter into cell A11 to find out how much money is left in her budget and to make sure the cell is updated wheneve
    9·1 answer
  • Using the Internet comes with certain risks that you should be prepared for. True False​
    11·2 answers
  • Wireless technology is best described as a/an
    7·2 answers
  • A security administrator is reviewing the following information from a file that was found on a compromised host: Which of the f
    9·1 answer
  • Rayna wants to create an organizational chart in her document. Which of the following commands should she click in the Illustrat
    14·1 answer
  • Write a program to have the computer guess at a number between 1 and 20. This program has you, the user choose a number between
    9·1 answer
  • dion training just installed a new webserver within a screened subnet. you have been asked to open up the port for secure web br
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!