TOPIC

Power Problem

Syed Rafsan Raiyan asked 11 months ago

include<bits/stdc++.h>

using namespace std;

int main() { long double NUM; char N[110];

scanf( "%le", &NUM );

sprintf( N, "%le", NUM );

if( N[0] != '-') cout << "+";

    printf("%.4le\n", NUM );

return 0;

}

**Here in output I'm getting -> +3.1416E+000 where it should be -> +3.1416E+00

                                          How to solve this?**

This topic has not been answered yet. Be the first!

Remember not post solutions. Your post may be reviewed by our moderators.