DEV Community

Nuriddin152
Nuriddin152

Posted on

O'zgaruvchilar

Ozgaruvchilar:

O'zgaruvchilar bular nima degan sovol tug'uladi. O'zgaruvchilarni biz ichi pustoy stakan deb tassavur qilamiz va bu stakanga biz qiymat kiritamiz. C++ da o'zgaruvchilar turli hil bo'ladi.

Bular:
O'zgaruvchilar - xotiraning nomlangan qismi bo'lib, o'zida ma'lum bir toifadagi qiymatlarni saqlaydi. O'zgaruvchining nomi va qiymatlari bo'ladi. O'zgaruvchining nomi orqali qiymat saqlanayotgan xotira qismiga murojaat qilamiz. Programma ishlashi jarayonida o'zgaruvchining qiymatini o'zgartirish mumkin. Har qanday o'zgaruvchini ishlatimizdan oldin, uni e'lon qilishimiz kerak.

int - integer - butun sonlar uchun "123"
float - kasr sonlar uchun "15.55"
double - bu ham kasr sonlar uchun faqat o'nli sonlari uchun"19.55"
string - faqat tekst uchun "Hello world"
bool - boolien - shartni to'g'ri toki noto'g'ri ekanligini aniqlab beradi "True" bo'lsa 1 "False" bo'lsa 0 chiqarib beradi

O'zgaruvchidan oldin raqam qoyib bo'lmaydi bunda eror chiqadi

Ozgaruvchiga qisqa nom qo'ysa bo'ladi va uzun nom qo'ysa boladi bu nom ko'dimizga hech halaqt berib qo'ymasi va eror chiqazib bermaydi
Misol uchun:

Image description
Natija: 15 Nuriddin

Image description

Natija: 15
15
30
45

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

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Dive into an ocean of knowledge with this thought-provoking post, revered deeply within the supportive DEV Community. Developers of all levels are welcome to join and enhance our collective intelligence.

Saying a simple "thank you" can brighten someone's day. Share your gratitude in the comments below!

On DEV, sharing ideas eases our path and fortifies our community connections. Found this helpful? Sending a quick thanks to the author can be profoundly valued.

Okay