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: