The task is as follows: In the array of real numbers Z = (z1, z2, ..., zm) determine the difference of the product and the sum of squares of all elements

It gives an error on lines 18 and 22:

Error (active) E2140 expression must be an integer type or an enumeration type with no scope

#include <stdio.h> int main(int argc, int endl, int cout, char* argv[]) { FILE *inp_stream, *out_stream; float inp_data, total_mul = 1, total_square = 1; inp_stream = fopen("c:/c++/input.txt", "r"); out_stream = fopen("c:/c++/output.txt", "w"); while ((fscanf(inp_stream, "%f", &inp_data)) != EOF) { total_mul *= inp_data; total_square += (inp_data*inp_data); cout << inp_data << endl; } cout << endl; total_mul -= total_square; cout << total_mul << endl; fprintf(out_stream, "%f", total_mul); fclose(inp_stream); fclose(out_stream); return 0; } 

What is the problem?

    1 answer 1

    Point one - what the ...?

     int main(int argc, int endl, int cout, char* argv[]) 

    What are int endl, int cout ??? For cout << you need

     #include <iostream> 

    and

     using namespace std; 

    not prevent.

    And then everything will compile. But it will still be wrong to work - at least why do you have the initial value of total_square equal to 1?

    In general, the mixture of "French with Nizhny Novgorod" - read C and C ++ - looks very ugly ...