COMP2113
COMP2113_ENGG1340 Programming technologies and Computer programming II [Section 2BC] [2023]
Loading...
Searching...
No Matches
checkpoint6.4.cpp File Reference
#include <iostream>
#include <cmath>
Include dependency graph for checkpoint6.4.cpp:

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

◆ main()

int main ( void )

Definition at line 5 of file checkpoint6.4.cpp.

5 {
6 int i;
7 cin >> i;
8 int a[15];
9 for (int j = 0; j < ((i > 15) ? 15 : i); j++){
10 a[j] = j*j;
11 }
12 for (int j = i; j < ((15 > i+5) ? i+5 : 15); j++){
13 a[j] = 0;
14 }
15 for (int j = i+5; j < 15; j++){
16 a[j] = pow(3,j);
17 }
18 for (int j = 0; j < 15; j++){
19 cout << a[j] << " ";
20 }
21}