Use float or double to define a decimal and then printf(“%f or %lf”,); output. For example:
#include
void main()
{
float a=3.14;
double b=3.1415926;
printf(“%f %lf”,a,b); //Note that those defined with float use %f for output, and those defined with double use %lf output.
}
It’s more troublesome to answer on a mobile phone! If you still don’t understand anything, please contact me tonight! Hope this helps you