Basic Data Types

  • + 0 comments

    Two issues with this hackerrank problem, the problem statement is not having a proper start heading, so its confusing! Second, it is not even mentioned that if the candidate decides to use setprecision, they will have to add a header as well #include. So #hackerrank team, please look inot it!

    Here is the solution for the problem in c++

    include

    include

    include

    using namespace std;

    int main() { int a; long b ; char c ; float d ; double e ;

    cin>>a>>b>>c>>d>>e;
    cout <<a<<endl;
    cout <<b<<endl;
    cout <<c<<endl;
    cout <<fixed<<setprecision(3)<<d<<endl;
    cout <<fixed<<setprecision(9)<<e<<endl;
    
    return 0;
    

    }