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
Katena32 [7]
3 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]3 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]3 years ago
3 0

Answer:

hi

Explanation:

You might be interested in
When Twitter is used to gather a large group for a face-to-face meeting it is called
Verdich [7]
The answer is flash mob. They called it flash mob when a large number of people in twitter gather in group for a centralized face to face meeting. In flash mob, people are gathering to be able to create a community that is helping each other or even just talking to each other.
8 0
3 years ago
When issued a GFE device, you are required to sign an AUP
pav-90 [236]
GFE stands for Government Furnished Equipment. While AUP is Acceptable Use Policy (AUP). The AUP  should be read and signed by employees annually.  <span><span> </span></span>The statement that "When issued a GFE device, you are required to sign an AUP" is true. 
7 0
3 years ago
Read 2 more answers
Seth would like to make sure as many interested customers as possible are seeing his business’s website displayed in their searc
GenaCL600 [577]

Answer:

Hi! Make sure that the website has a few things. Proper Keywords, the pages have the proper tags, a form on the website, contact information, CIty State, Etc., Then a phone number. Social media icons that link properly to the social media pages.

Explanation:

5 0
3 years ago
Which of the following is usually used to connect a monitor to a computer?
viva [34]

Answer:

DVI cable

Explanation:

DVI is for video signals.

Some monitors have a usb hub built in and therefore also have a USB connection, but that is not their primary function.

5 0
3 years ago
Read 2 more answers
When creating a database, in which step do you add foreign keys to tables?
lana66690 [7]
Https://docs.microsoft.com/en-us/sql/relational-databases/tables/create-foreign-key-relationships 
8 0
3 years ago
Other questions:
  • What technology process would help you access files at all times?
    11·1 answer
  • How would a programming language that allows programs to run on any operating system be classified?
    11·1 answer
  • Most browsers allow you to maintain your most frequently visited websites. what is this called? Special place holder, secret lis
    6·2 answers
  • What are the factors affecting the purchasing decision for dbms software?
    7·2 answers
  • What is network topology? PLZZZ HURRY
    9·1 answer
  • Which of the following is NOT a file format used for word processing documents? A. .ppt B. .rtf C. .doc D. .odt
    5·1 answer
  • A thesaurus is an example of a(n)
    5·2 answers
  • A UI text element must be added to ______.an empty background container game objecta prefaba slot game objecta tray objecta canv
    6·1 answer
  • Hosts on the Internet have ________ addresses. Group of answer choices both A and B neither A nor B IP data link
    13·1 answer
  • Pls paanswer asap......​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!