0

Why this code doesnt work?

const float PI= 3.14; Console.WriteLine(PI); // ERROR const double PI=3.14; Console.WriteLine(PI); // NO ERROR please help me there..

13th Aug 2019, 8:13 AM
DataStream Cowboy
DataStream Cowboy - avatar
3 ответов
+ 3
All decimals are treated as double by default, to specify a float, suffix the number with an "f". const float pi = 3.142f; // float const double pi = 3.142; // double
13th Aug 2019, 8:23 AM
Dlite
Dlite - avatar
0
D'Lite thanks i got you
13th Aug 2019, 1:20 PM
DataStream Cowboy
DataStream Cowboy - avatar
Актуальное сегодня
What?
0 Votes
HTML
0 Votes
Quiz duel
0 Votes
FRC Coding?
1 Votes
help
0 Votes
AI
2 Votes
APIs
1 Votes
Create Agent
0 Votes