Answer to Question #7942 in C++ for ronnie

Question #7942
using arrays write a simple program to display numbers 1-20
1
Expert's answer
2012-03-29T13:01:47-0400
#include <iostream>
using namespace std;

int main()
{
int arr[20];
int i;
for (i=0;i<20;i++)
{
& arr[i] = i+1;
}
for (i=0;i<20;i++)
{
& cout<<arr[i]<<" ";
}
cout<<endl;
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
New on Blog
APPROVED BY CLIENTS