write a program in c++ to accept a set of array numbers in size 10 and print the numbers using pointers.
Answers
Answered by
0
I WILL GIVE ANSWER BUT PLEASE FOLLOW ME AND MARK ME AS BRAINLLIST SO THAT I AM GIVING POINT EVERYDAY FREE
Answered by
0
Answer:
#include <iostream>
using namespace std;
int main()
{
int arr[10];
cout << "Enter 10 numbers: ";
for (int i = 0; i < 10; i++) {
cin >> arr[i];
}
int *ptr = arr;
cout << "The numbers are: ";
for (int i = 0; i < 10; i++) {
cout << *(ptr + i) << " ";
}
return 0;
}
Similar questions
English,
4 months ago
Social Sciences,
8 months ago
English,
8 months ago
Biology,
11 months ago
Computer Science,
11 months ago
English,
11 months ago