Answer to Question #27704 in C++ for red rose

Question #27704
write a program to input 9 values in an array named volts. After the data has been entered , have your program display the values.
1
Expert's answer
2013-04-04T05:20:58-0400
#include<iostream>

using namespace std;

int main()
{
const int arraySize = 9;
int volts[arraySize];

for(int i=0;i<arraySize;i++)
{
cout<<"Input "<<i+1<<" value: ";
cin>>volts[i];
}

cout<<"volts array contents : ";
for(int i=0;i<arraySize;i++)
{
cout<<"["<<volts[i]<<"] ";
}

//suspend the console
cin.get();
cin.get();

return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS