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
QveST [7]
3 years ago
8

Look at the following code.int x = 7;int *iptr = &x;What will be displayed if you send the expression *iptr to cout ? What h

appens if you send theexpression ptr to cout ?
Computers and Technology
1 answer:
masha68 [24]3 years ago
4 0

Answer:

The answer to the given question can be given as:

The value of *iptr is 7. and the value of iptr is dynamic.

Explanation:

In the c++ code, it is defined that x is an integer variable that assigns a value which is 7. Then we define a pointer variable that is *iptr. This variable holds an address of the x variable. When we print the value of the iptr variable. if we use the expression *iptr to print value of the pointer variable by cout that is used in c++ for pint values. so the value of the iptr is 7. If we use the expression iptr sent to cout so we show the address of the variable x. In the pointer, it manages the addresses of dynamically allocated so the address of the variable is changed on execution time.

You might be interested in
Write a program that accepts a number as input, and prints just the decimal portion.
Olegator [25]

<u>Answer:</u>

<em>There are 2 ways to do extract the decimal part: </em>

<u>Explanation:</u>

  • <em>First method using number  </em>

<em>int main() { </em>

<em>  double num = 23.345; </em>

<em>  int intpart = (int)num; </em>

<em>  double decpart = num - intpart; </em>

<em>  printf(""Num = %f, intpart = %d, decpart = %f\n"", num, intpart, decpart); </em>

<em>} </em>

  • <em>Second method using string: </em>

<em>#include <stdlib.h> </em>

<em>int main() </em>

<em>{ </em>

<em>    char* inStr = ""123.4567"";          </em>

<em>    char* endptr;                       </em>

<em>    char* loc = strchr(inStr, '.'); </em>

<em>    long mantissa = strtod(loc+1, endptr); </em>

<em>    long whole = strtod(inStr, endptr);  </em>

<em>    printf(""whole: %d \n"", whole);      </em>

<em>    printf(""mantissa: %d"", mantissa);   </em>

<em>} </em>

8 0
3 years ago
Read 2 more answers
Mark for review (Will be highlighted on the review page) 3. Which one of the following word processing features saves you the mo
Maksim231197 [3]
B- find and replace can replace any word in the document with another.

7 0
3 years ago
QUESTION 11
tino4ka555 [31]

Answer:

x == 32

Explanation:

CODE in Java:

       int x = 32;

       if(x == 32){

           System.out.println("Pass");

       }

       else{

           System.out.println("Fail");

       }

OUTPUT:

Pass

8 0
2 years ago
A student is reading a book for language arts. She has to finish three chapters by class tomorrow, because there will be a quiz.
Jobisdone [24]

Answer:

Distracted..?

8 0
3 years ago
Read 2 more answers
Anyone help me with number 41.
Katarina [22]
It is te = t I yhink
8 0
3 years ago
Other questions:
  • Write a class named Averager containing: An instance variable named sum of type integer, initialized to 0. An instance variable
    6·1 answer
  • Look at the following Python code:
    11·1 answer
  • Why do objects in the back seat move when the car turns
    11·1 answer
  • Write a program that lets a maker of chips and salsa keep track of their sales for five different types of salsa they produce: mi
    8·1 answer
  • What is the purpose for adding images and graphics to a web page?
    5·1 answer
  • To see a custom, object-specific action on the palette of the page layout editor: A. Click Layout Properties on the page layout
    11·1 answer
  • You listened to a song on your computer. did you use hardware or software? explain.
    15·1 answer
  • A restaurant has a case type that allows customer to book the dining room for events. Customers provide basic information includ
    7·1 answer
  • MULTIPLE CHOICE:
    15·1 answer
  • What Is the device used to produce hard copies from personal computer ​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!