Download - Array Program

Transcript

/*Author: Roderick BennettClass: C++ Programming Online, Fall 2013Assignment: Chapter 8, Programming Exercise 1This program creates an array named Alpha of 50 components of type double.The output of the program computes the square of the first 25 indices andTakes 3 times the index of the remaining indices. The output is displayedon the screen with ten numbers per line.*/

#include

using namespace std;

const int N = 50;

int main()

{int alpha[N];

for (int i = 0; i < N; i++){if (i < 25){alpha[i] = i*i;}elsealpha[i] = 3 * i;}

cout


Top Related