In: Computer Science
Yes, it is fine to enter double before const in c++
The following code depict the condition for the given case.
Code in text format:-
#include <iostream>
using namespace std;
int main()
{
double const a=10;
cout<<a;
}
Output:-
Note:-
1.we cant change the constant value throughout the program ,if we try to modify the constant we will get an error.
The following depicts the case:
Code in text format:-
#include <iostream>
#include <iomanip>
using namespace std;
int main()
{
double const a=10;
a=a+10;
cout<<a;
}
Output:-
If you have any queries please comment
If you liked the answer please give me a thumbs up.Thanking you