answer.
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
Katena32 [7]
2 years ago
5

For the following code, if the input is negative, make numitemsPointer be null. Otherwise, make numitemsPointer point to numitem

s and multiply the value to which numitems Pointer points by 10.
Ex: If the user enters 99, the output should be: Items: 990
Code :
#include
int main(void) {
int* numItemsPointer;
int numItems;
scanf ("%d", &numItems);

/* Your solution goes here */

if (numItems Pointer == NULL) {
printf ("Items is negative\n");
}
else { printf("Items: %d\n", *numItemsPointer);
}
return 0;
}
Computers and Technology
2 answers:
weeeeeb [17]2 years ago
7 0

Answer:

The program to this question can be described as follows:

Program:

#include <stdio.h> //defining header file  

int main() //defining main method

{

int* numItemsPointer; //defining pointer variable

int numItems; //defining integer variable

scanf ("%d", &numItems); //input value from user end

if(numItems < 0) //defining if block to check value

{

   numItemsPointer = NULL; //assign value to null

   printf ("Items is negative\n"); //print message

}

else //else block

{

   numItemsPointer = &numItems; //holds address

   numItems = numItems * 10; //multiple by 10

   printf("Items: %d\n", *numItemsPointer); //print value

}

return 0;

}

Output:

99

Items: 990

Explanation:

In the above program two integer variable "numItemsPointer and numItems" is defined, in which numItemsPointer is a pointer variable and numItems is integer variable, in which we input value from the user end, and an if condition statement is used, that check and calculate the values, which can be described as follows:

  • In the if block a condition is defined that variable "numItems" is less then 0, if this condition is true so, inside the block, it will assign a value, that is equal to "NULL", and prints its value.
  • If the condition is not true it will go to the else block, in this block, it will first pointer variable holds the variable address, and multiply the value by 10, and prints pointer variable value.
77julia77 [94]2 years ago
3 0

Answer:

hi

Explanation:

You might be interested in
The _______________ domain refers to any endpoint device used by end users, which includes but is not limited to mean any smart
viva [34]
The answer is <span>workstation.   </span>The workstation domain refers to any endpoint device used by end users, which includes but is not limited to mean any smart device in the end user's physical possession and any device accessed by the end user, such as a smartphone, laptop, workstation, or mobile device.
5 0
2 years ago
A(n) ______of the audio or video clip makes the content easily accessible to people with hearing disabilities.
defon

subtitles

hope that helped you

7 0
2 years ago
Read 2 more answers
Kelli is unable to find a shape that meets her needs which feature in PowerPoint should she use to create shapes that are comple
sergij07 [2.7K]

In order to customize a shape, Kelli should first add a basic shape and select it. After that, she needs to access the format tab where she can find the option to edit the selected shape. She can modify the selected shape or change it to a free-form according to her needs.

<u>Explanation:</u>

Microsoft PowerPoint provides an easy way for customizing the shapes according to the needs of the user.

Although PowerPoint provides many basic shapes that suit the need of most of the users but in exceptional cases, changes are always welcome. So in order to customize a shape, she should follow the steps which has been explained above.

5 0
2 years ago
The problem solving process begins by first ______ the problem.
alexandr402 [8]

Answer:

identifying/acknowledging

Explanation:

7 0
2 years ago
Given 4 floating-point numbers. Use a string formatting expression with conversion specifiers to output their product and their
Snowcat [4.5K]

Answer:

search it on

Explanation:

<h2>GGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOOGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGGLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE</h2>
5 0
2 years ago
Other questions:
  • Which of the following is true about simulation games? A. Simulation games involve competing in a sport against other players. B
    10·2 answers
  • Many organizations keep copyrighted information on their intranets, which is one reason usernames and passwords are required. Tr
    13·1 answer
  • Mr. Cooper would like to customize his Excel software so his students can create an electronic graph in Excel for their lab repo
    6·1 answer
  • When a machine on the public network wants to reach the server at 172.30.0.10, which ip will it use?
    6·2 answers
  • Consider an application that transmits data at a steady rate (for example, the sender generates an N-bit unit of data every k ti
    8·1 answer
  • Programming challenge description: Write a program that, given two binary numbers represented as strings, prints their sum in bi
    6·1 answer
  • Jennifer has written a short story for children. What should be her last step before she submits the story for publication?
    11·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C++, division by zero is always an error. Given a int variable named
    9·1 answer
  • Write a program that simulates the functionality of a vending machine having the following characteristics:• The vending machine
    11·1 answer
  • Given positive integer numInsects, write a while loop that prints that number doubled without reaching 200. Follow each number w
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!