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
DENIUS [597]
3 years ago
12

Write a program that defines an array of integers and a pointer to an integer. Make the pointer point to the beginning of the ar

ray. Then, fill the array with values using the pointer (Note: Do NOT use the array name.). Enhance the program by prompting the user for the values, again using the pointer, not the array name. Use pointer subscript notation to reference the values in the array.
Computers and Technology
1 answer:
Reptile [31]3 years ago
3 0

Answer:

#include<iostream>

using namespace std;

int main()

{

  int a[20],n;

  int *p;

  cout<<"\n enter how many values do you want to enter:";

  cin>>n;

  for(int i=0;i<n;i++)

  {

      cout<<"\n Enter the "<<i+1 <<"th value :";

      cin>>*(p+i);

      //reading the values into the array using pointer

  }

  cout<<"\n The values in the array using pointer is:\n";

  for(int i=0;i<n;i++)

  {

      cout<<"\n (p+"<<i<<"): "<<*(p+i);

      //here we can use both *(p+i) or p[i] both are pointer subscript notations

  }

}

Output:

You might be interested in
A computer system has 9,850 processes and 172 of them were suspended while 276 of them were terminated. Explain why some of the
Mrrafil [7]

Answer:

Check below for answers and explanations.

Explanation:

The major reasons why computer processes are suspended or terminated are:

1. When there is insufficient memory for successful completion of the process

2. When there's an unauthorized access of any of the computer resources by the process.

It is possible that some processes are terminated why some are suspended because, when the system runs out of memory, the running processes are put on hold until the system is able to create free memory space for the completion of the process. In this case the process is suspended. But if the system cannot provide enough space for the process, the process is terminated.

In the example provided in this exercise, some of the processes were suspended because the system wants to create free memory space for their completion while others are terminated either because the available space is not sufficient for their completion or they want to access an unauthorized resources on the system.

4 0
3 years ago
Select the correct answer.
Naddika [18.5K]

Answer:

E

Explanation:

4 0
3 years ago
Commercials are short media advertising that persuades a consumer to buy/use their product/service?
ioda

Answer:

true

Explanation:

thats what they are

6 0
3 years ago
Read 2 more answers
PI
siniylev [52]

Explanation:

As the qn was copy pasted from another document...the qn seems incorrect... and incomplete..

pls see to it and attach the correct qn...

sorry

4 0
2 years ago
Mirrors on cars exist to
Ghella [55]

Answer:

Mirrors exist on cars so objects behind or to the side of the vehicle are brought into the driver's view. (such as cars, bicyclists, etc.) These spots are normally referred to as "blind spots", which are locations outside of the driver's peripheral vision that are difficult to see.

8 0
2 years ago
Other questions:
  • "a terminal has two input queues." as a user types each character to the terminal, it is collected in the ____ queue.
    5·1 answer
  • Which command executed in Windows PE would transfer both the files and directory structure from one device to another device or
    6·1 answer
  • How do you change brightness on acer laptop?
    7·1 answer
  • The open items on your computer are displayed here.
    12·1 answer
  • To determine the average of a range of numbers, click the ____ in the formula bar, then click average.
    13·1 answer
  • Is badlion safe and how ?
    14·1 answer
  • Initialized the variable with the value 0
    11·2 answers
  • How are comments in a Java program treated by the compiler?
    14·2 answers
  • Which display technology was developed by apple, produces vibrant colors, and supports viewing from all angles?
    12·1 answer
  • Here’s my last question
    12·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!