DEV Community

BUTTSAN
BUTTSAN

Posted on

1 1 1 1 1

salom biz 6.08.24 sanasida c++ code lash tilida 2 darsimizni otdik va bu meni tasuryotlarim

birinchi bolib men sizlarga men bilmagan narsalarim haqida aytmoqchiman
int son = 12; // int faqat butun sonlar hotira 4 bite

float kasrSon = 15.71; // kasr son 4 bite

double kasr_Son = 23.12345; // double kasr son 8 bite

string text = "salom"; // str textni saqlaydi

char belgi = "="; // char faqat 1 belgi 1 bite

bu lar code ni hotirada nechi bite olishi haqida malumot .
2.
cin - oldindan belgilangan o'zgaruvchi bo'lib, ekstraktsiya operatori (>>) yordamida klaviaturadan ma'lumotlarni o'qiydi.

Quyidagi misolda foydalanuvchi x o'zgaruvchisida saqlanadigan raqamni kiritishi mumkin. Keyin x qiymatini chop etamiz:
int x;
cout << "raqqam yoz: ";
cin >> x;
cout << "Sening raqaming: " << x;

3.
int to int ==> int
int to float ==> float
float to float ==> float
float to int ==> float

float 4 bayt Bir yoki bir nechta o'nli kasrlarni o'z ichiga olgan kasr sonlarni saqlaydi. 6-7 o'nlik raqamlarni saqlash uchun etarli

  1. char

Char ma'lumotlar turi bitta belgini saqlash uchun ishlatiladi. Belgi "A" yoki "c" kabi bitta tirnoq bilan o'ralgan bo'lishi kerak:

include

using namespace std;

int main () {
char sinfim = 'B';
cout << sinifim;
return 0;
}

console:
B.

va agar hechtima qolib kotmagan bolsa hayir

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

Top comments (1)

Collapse
 
_e9348e45782d50818 profile image
BUTTSAN

hi

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

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

Okay