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
Which of the following did you include in your notes?
iVinArrow [24]

Answer:

How you will be innovative in what you offer

Explanation:

personally I think all 3 but it is what it is

6 0
3 years ago
In a category of games known as _________, millions of players connect to various servers to team up with other players in very
aivan3 [116]

In a category of games known as MMORPGs, millions of players connect to various servers to team up with other players in very large virtual worlds.

<h3>What do MMORPGs mean?</h3>

The term  MMORPG connote  massively multiplayer online role-playing games.

This is known to be a type of video game that tends to make use of different elements of role-playing games (RPGs) along with those of the gameplay of multiplayer online gaming worlds.

Therefore, In a category of games known as MMORPGs, millions of players connect to various servers to team up with other players in very large virtual worlds.

Learn more about virtual worlds from

brainly.com/question/13873769

#SPJ1

3 0
1 year ago
What is a attack vector<br>​
kogti [31]

Answer: A vector in computing, specifically when talking about malicious code such as viruses or worms, is the method that this code uses to propagate itself or infect a computer. This sense is similar to, and derived from, its meaning in biology

Explanation:

give me a Brainliest

3 0
3 years ago
What are the XML technologies used in SOA?
saw5 [17]

Answer:

There are three technologies used for implementing the SOA most commonly with Web services are UDDI (Universal Description, Discovery & Integration) , WSDL (Web Services Description Language) and  SOAP (Simple Object Access Protocol) .

Out of them XML technologies are Web Services Description Language (WSDL) and Simple Object Access Protocol (SOAP).

WSDL is an XML language that describes a Web service.

SOAP is an XML Protocol and it is used by client application to communicate with web services.

8 0
3 years ago
Which of the following is true regarding Moore’s Law? A.) explained the growth in computing capabilities between 1965 and 1995 B
liraira [26]

answer is B :)

Moore's Law states that we can expect the speed and capability of ... will double about every two years

3 0
3 years ago
Other questions:
  • On a DTP project, Morgan is preparing digital files to be sent to a printer. Which word describes the activity that Morgan is pe
    5·2 answers
  • When Amy turns on her computer, she notices a burning smell. Smoke comes out of the case, and Amy immediately turns off her comp
    7·1 answer
  • Network administrators ____ to set up the browsers on the network to use a proxy server.
    12·1 answer
  • Get these points why they hot!!!!!!!!!!!!!!!!!!!!
    14·2 answers
  • Why should you need to have skills and an understanding about programming?
    8·1 answer
  • Elwin Osbourne, CIO at GFS, Inc., is studying employee use of GFS e-mail for non-business communications. He plans to use a 98%
    6·1 answer
  • The system partition is the partition that contains the files required to load the operating system (bootmgr, and BCD). The syst
    9·1 answer
  • What is the cffa act
    5·2 answers
  • On his website, Mario has a video that visitors must click to play. He wants the video to play automatically when the page loads
    8·1 answer
  • Compare the graphs. Find the value of h, k, or a.
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!