Hello, someone could help me with this exercise it's about Reading numbers: Write a program that reads a group of 10 numbers from the
user and place them inside a float type array. Once the numbers are
stored in the array, the program must calculate the average of these numbers and must
print the result on the screen. Use only pointer notation. For this one
exercise, it is forbidden to access the indexes by means of square brackets ([]).
1
Expert's answer
2017-12-04T14:18:07-0500
#include<iostream> using namespace std;
int main(int argc, char* argv[]) { float arr[10],avrg=0; cout<<"Enter 10 numbers:"<<endl; for(int i=0;i<10;i++) { cin>>*(arr+i); avrg+=*(arr+i); } avrg/=10; cout<<"Average of numbers is "<<avrg<<endl;
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment