Check out example codes for "basic data types in c++ hackerrank solution". It will help you in understanding the concepts better.

Code Example 1

#include <iostream>
using std::cin;
using std::cout;
using std::endl;
using std::fixed;

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.precision(3);
    cout<<fixed<<d<<endl;
    cout.precision(9);
    cout<<fixed<<e<<endl;
    return 0;
}

Learn ReactJs, React Native from akashmittal.com