Answer the question
In order to leave comments, you need to log in
Why doesn't addition work?
#include <iostream>
#include "locale.h"
using namespace std;
int main()
{
setlocale(LC_ALL, "Russian");
system("chcp 1251");
float n, total = 0;
cout << "Программа для вычисления числового ряда" << endl;
cout << "Введите число слагаемых в числовом ряде: ";
cin >> n;
for (int i = 1; i <= n; i++) {
total += (1 / 4);
cout << endl << total << endl;
}
cout << "Сумма числового ряда из " << n << " слагаемых = " << total;
return 0;
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question