G
G
gelver2020-11-24 19:06:45
C++ / C#
gelver, 2020-11-24 19:06:45

Why is the error in c++ code?

I run the program

#include <iostream>
using namespace std;

int main()
{
    
    for (double i = 0; i < 100; i++) {
        cout << i << "земной фут равен" << i * 0, 19 << "футов \n" ;
                                                                                   
    };

}

marks an error in "feet \n" , why?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Olegofr3n77, 2020-11-24
@gelver

#include <iostream>
using namespace std;

int main()
{

for (double i = 0; i < 100; i++)
{
   cout << i << "земной фут равен" << i * 0,19;
   cout << "футов \n"  << endl;
};

}

S
scottparker, 2020-11-24
@scottparker

Isn't 0.19 written with a dot?)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question