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
Which are emotional effects of anxiety? Check all that apply.
IRINA_888 [86]
Panic, worry, and anger. nausea and headache are physical effects
7 0
3 years ago
Read 2 more answers
in a typical e-mail address, the "host" is A. an account designated by a user name B. CPU processor 2500 C. the receiver of an e
NISA [10]
The correct answer is A! :)
5 0
3 years ago
Read 2 more answers
_____ is software that is embedded into hardware in order to control the device.
Naddik [55]
Firmware
Think of it as a super tiny operating system for just that one device. 
6 0
3 years ago
Henry Ford would have been most interested to bring which modern innovation to his automotive factories?
kondor19780726 [428]
Henry Ford would have been most interested to bring assembly lines which is an modern innovation to his autmotive factories. Although Henry Ford didn't invent cars he developed assembly lines
3 0
3 years ago
Read 2 more answers
Which of the following does not reflect the second step of effective communication?
Ilya [14]

Answer:

c

Explanation:

3 0
3 years ago
Read 2 more answers
Other questions:
  • 24 bit or 16 million colors is often called?
    7·1 answer
  • Assume that Precinct Report is a structured type with these fields,address (a string),and three int fields which are counts of c
    12·1 answer
  • You are an online training company and stream a lot of training videos from your
    12·1 answer
  • Hi need help on this <br> what is cyberspace
    14·1 answer
  • Which statement gives an advantage of multicellular organisms?
    7·2 answers
  • In 2019, the tuition for a full time student is $7,180 per semester. The tuition will be going up for the next 7 years at a rate
    14·1 answer
  • Correct single error in this. Try to appear relaxed, but not to relaxed​
    13·1 answer
  • How to reload ingenuity when a pulsating blue thing is there
    11·1 answer
  • The number of distinct proper subsets of a set with n elements is.
    13·1 answer
  • Which method can be used for making a robot perform a different set of functions?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!