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
You are troubleshooting a client connectivity problem on an Ethernet network. The client system has intermittent connectivity to
lutik1710 [3]

Answer:

<em><u>D. The UTP cable does not support transmission distances of 75 feet without signal regeneration.</u></em><em> </em>

<em> is the </em><em>most</em><em> </em><em>likely cause of the connectivity problem</em><em>.</em>

Explanation:

hope it will help you

7 0
3 years ago
A thin red border indicates the active cell. (True or False)
sergij07 [2.7K]
<span>It is false that a thin red border indicates the active cell. As a matter of fact, an active cell is indicated by a thin green border. That means that you have clicked that particular cell, and that it is activated, so that you can use it and write whatever you want there. Usually, even in the real world, green means that something is active, and red that it is inactive.</span>
3 0
3 years ago
What is the recommended secure protocol for voice and video applications? secure real-time transport protocol (srtp) hypertext t
snow_tiger [21]
The recommended secure protocol for voice and video applications is the Secure<span> Real-time Transport </span>Protocol<span> (SRTP) protocol. SRTP is a Real-time Transport </span>Protocol (RTP) profile used to  to provide encryption, message authentication and integrity.
The default cipher of SRTP is the Advanced Encryption Standard<span> (AES) .</span>
8 0
4 years ago
A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line u
yawa3891 [41]
<span>A type of cpu socket, used with modern intel processors, where the cpu itself has no pins but the contact pads of the cpu line up with socket pins on the motherboard, is known as LGA.  </span>The Land Grid Array (LGA<span>) is a type of surface-mount packaging for ICs (</span> integrated circuits)<span> that is notable for having the pins on the </span>socket<span> (when a </span>socket is used) rather than the integrated circuit.
3 0
3 years ago
Read 2 more answers
Which component of service-oriented DSS can be defined as data that describes the meaning and structure of business data, as wel
Licemer1 [7]

Answer:

The correct answer to the following question will be Metadata Management.

Explanation:

The management of data about the other data is known as Metadata Management. When the data is generated, updated, deleted, created, metadata is generated.

Benefits of Metadata management:

  • To locate data for a person, the metadata management make it easier.
  • Project delivery become faster.
  • Maintain information of organization.

Hence, the Metadata Management will be the best suitable component which defined as the structure and meaning of business data.

4 0
3 years ago
Other questions:
  • The first digital keyboard was the DX-7, introduced by the Yamaha company in 1983.
    15·1 answer
  • When a Firewall is a hardware interface, it is referred as a
    6·1 answer
  • Webster defines risk as "the possibility of loss or injury". Therefore, driving a motor vehicle is a risk.
    12·1 answer
  • Write a java program which uses methods for calculating the sum of any 5 non-zero integer digits that are input. The program mus
    8·1 answer
  • Which of these would NOT be a valid Internet Control Message Protocol (ICMP) error message:
    6·1 answer
  • Susan works for a company that values their employees me and deadlines in finding ways to keep the cost of doing business low wh
    12·1 answer
  • There are many commercially made household linens found in the?
    7·1 answer
  • If the starting address location changes, in which of the following cases, the program has to be recompiled? Select one: a. Both
    12·1 answer
  • A good information that contains the facts necessary for decision makers to solve a problem is characterized by the __________.
    15·2 answers
  • Provide 3to 4 sentence overview of microsoft windows features?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!