#include <iostream>
int main()
{
const int start = 9;
const int end = 15;
const int step = 1;
int m[7]{};
for (int i = start; i <= end; i += step) {
int index = i - start;
m[index] = 3 * i + 7;
std::cout << "m[" << index << "] = " << m[index] << '\n';
}
return 0;
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
#include <iostream>
int main()
{
const int start = 9;
const int end = 15;
const int step = 1;
int m[7]{};
for (int i = start; i <= end; i += step) {
int index = i - start;
m[index] = 3 * i + 7;
std::cout << "m[" << index << "] = " << m[index] << '\n';
}
return 0;
}