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
madam [21]
3 years ago
13

When a variable is stored in memory, it is associated with an address. To obtain the address of a variable, the & operator c

an be used. For example, &a gets the memory address of variable a. Let's try some examples.
Write a C program addressOfScalar.c by inserting the code below in the main function.

Questions:
1) Run the Cprogram, attach a screenshot of the output in the answer sheet.
2) Attach the source code in the answer sheet
3) Then explain why the address after intvar is incremented by 4 bytes instead of 1 byte.
Engineering
1 answer:
liubo4ka [24]3 years ago
3 0

Answer:

Explanation:

1) C program file addressOfScalar.c

#include <stdio.h>

int main()

{

//intialize a char variable, print its address and the next address

char charvar = 'a';

printf("address of charvar = %p\n", (void *)(&charvar));

printf("address of charvar - 1 = %p\n", (void *)(&charvar - 1));

printf("address of charvar + 1 = %p\n", (void *)(&charvar + 1));

//intialize a int variable, print its address and the next address

int intvar = 1;

printf("address of intvar = %p\n", (void *)(&intvar));

printf("address of intvar - 1 = %p\n", (void *)(&intvar - 1));

printf("address of intvar + 1 = %p\n", (void *)(&intvar + 1));

}

In C programming language, an int variable takes 4 bytes of memory. So any arithmetic on integer address, always considers it as 4 bytes of data. So intvar-1 refers to a location 4 bytes before intvar's address and intvar+1 refers to 4 bytes after intvar's address.

You might be interested in
14. The top plate of the bearing partition
aliina [53]

Answer:

d. is applied after the ceiling joists are

installed.

7 0
3 years ago
It is appropriate to use the following yield or failure criterion for ductile materials (a) Maximum shear stress or Tresca crite
Nataly [62]

Answer:

(b)Distortion energy theory.

Explanation:

The best suitable theory for ductile material:

       (1)Maximum shear stress theory (Guest and Tresca theory)

It theory state that applied maximum shear stress should be less or equal to its maximum shear strength.

      (2)Maximum distortion energy theory(Von Mises henkey's        theory)

It states that maximum shear train energy per unit volume at any point  is equal to strain energy per unit volume under the state of uni axial stress condition.

But from these two Best theories ,suitable theory is distortion energy theory ,because it gives best suitable result for ductile material.

6 0
3 years ago
The greater the force applied to an object, the _____ the change in speed or direction of the object.
storchak [24]

Answer:

b

Explanation:

8 0
3 years ago
Given a mass-spring-damper system. The impulse response of strength 1 can be obtained from a unit step response by: ______
Alina [70]

Answer:

Multiplying impulse response by t  ( option D )

Explanation:

We can obtain The impulse response of strength 1 considering a unit step response by Multiplying impulse response by t .

When we consider the Laplace Domain, and the relationship between unit step and impulse, we can deduce that the Impulse response will take the inverse Laplace transform of the function ( transfer ) . Hence Multiplying impulse response by t will be used .

5 0
3 years ago
I WILL GIVE BRAINLIEST IF ANSWER FAST What is the measurement on this Dial Caliper?
garik1379 [7]

Answer:

b i think i dont see any dial caliper

Explanation:

8 0
3 years ago
Other questions:
  • A package is thrown down an incline at A with a velocity of 1 m/s. The package slides along the surface ABC to a conveyor belt w
    13·1 answer
  • A. Derive linear density expressions for BCC [110] and [111] directions in terms of the atomic radius R.
    7·1 answer
  • Which one of the following activities is not an example of incident coordination
    15·1 answer
  • Determine the number of flipflops required to build a binary counter that count from 0 to 2043
    14·1 answer
  • What is the measurement below?
    12·1 answer
  • Explain with examples:<br> What are the reasons of a successful and unsuccessful software project?
    8·1 answer
  • Which of the following can effect LRO?
    12·1 answer
  • On some engines after torquing cylinder head fasteners you must
    12·1 answer
  • Which material has the highest cp value?
    10·1 answer
  • Technician a says that personal protective equipment (ppe) does not include clothing. technician b says that the ppe used should
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!