DEV Community

Sanjar Rashidov
Sanjar Rashidov

Posted on

3 3 3 3 3

Variables & Data types

Variables - O'zgaruvchi kompyuterni xotirasida ma'lum bir qiymatlarni saqlash uchun kerak bo'ladi.

Data types - Ma'lumot turlari.

Quydagi data typelar butun sonlar uchun ishlatiladi:
1.int
2.long
3.short

Quydagi data typelar kasr sonlar uchun ishlatiladi:
1.double
2.float
Double _float_dan xotira jihatdan kottaroq

Quydagi data typelar tekst va matnlar uchun ishlatiladi:
1.string

Quydagi data typelar belgilar uchun ishlatiladi:
1.char

DATA TYPELARNI XOTIRADAN OLADIGAN JOYI

  • int -> 4 byte
  • long -> 8 byte
  • short -> 2 byte
  • double -> 8 byte
  • float -> 4 byte
  • string -> 32 byte
  • char -> 1 byte
#include <iostream>

using namespace std;

int main()
{
    int son1 = 20;
    long son2 = 123;
    short son3 n = 4;
    double kasr1 = 123.4;
    float kasr2 = 12.3;
    string ism = "Bobur";
    char belgi = '$';

    cout << son1 << endl;
    cout << son2 << endl;
    cout << son3 << endl;
    cout << kasr1 << endl;
    cout << kasr2 << endl;
    cout << ism << endl;
    cout << belgi << endl;

    return 0;
}

Enter fullscreen mode Exit fullscreen mode

Speedy emails, satisfied customers

Postmark Image

Are delayed transactional emails costing you user satisfaction? Postmark delivers your emails almost instantly, keeping your customers happy and connected.

Sign up

Top comments (0)

The Most Contextual AI Development Assistant

Pieces.app image

Our centralized storage agent works on-device, unifying various developer tools to proactively capture and enrich useful materials, streamline collaboration, and solve complex problems through a contextual understanding of your unique workflow.

👥 Ideal for solo developers, teams, and cross-company projects

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay