Basic Data Types

  • + 0 comments

    Little counterintuitive, but works none the less. Simple, easily understandable code you can use (no credit)

    #include <iostream>
    #include <cstdio>
    using namespace std;
    
    int main() {
        int a;
        long b;
        char c;
        float d;
        double e;
        
        scanf("%d %ld %c %f %lf", &a, &b, &c, &d, &e);
        printf("%d", a);
        cout << endl;
        printf("%ld", b);
        cout << endl;
        printf("%c", c);
        cout << endl;
        printf("%f", d);
        cout << endl;
        printf("%lf", e);
        cout << endl;
        return 0;
    }