#include <iostream>
#include <limits> // Menambahkan header limits
using namespace std;
int main(){
    // bilangan bulat
    unsigned int a = 5; // 32-bit
    long b = 6;
    short c = 7;

    // bilangan decimal
    float d = 1.0;
    double e = 2.5;

    // character
    char f = 'a'; //character 1-bit

    // boolean
    bool g = true; // true/false

    cout << a << endl;
    cout << sizeof(a) << " byte" << endl;

    // Menggunakan numeric_limits untuk tipe unsigned int
    cout << numeric_limits<unsigned int>::max() << endl;
    cout << numeric_limits<unsigned int>::min() << endl;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: