DEV Community

Cover image for C++ foundation | Kirish
sardorbek095
sardorbek095

Posted on • Edited on

3 2

C++ foundation | Kirish

C++ dasturlash tili haqida boshlang'ich ko'nikmalar


#include <iostream>

using namespace std;

int main()
{
    cout << "Salom dunyo" << endl;
    return 0;
}
Enter fullscreen mode Exit fullscreen mode

1 #include orqali bizga kerakli kutubxonalarni chaqiramiz!

  • #include <iostream>(input/output stream) ya'ni kiritish chiqarish oqimini boshqaradigan kutubxonani qo'shish

2 std::

  • using namespace std; Bu code orqali std::(standartni) qayta-qayta yozavermaslik ishlatiladi

3 int main()

  • int main() funksiyasi dasturga kirish funksiyasi hisoblanadi. Bu funksiyani ishatilishda 2ta shart bor: mavjud bo'lishi va yagona bo'lishi!

4 console out ya'ni cout

  • cout console ga tekst va sonlarni chop etadi!

5 string

  • string bu tekst deyiladi va " " ichida yoziladi!

Masalan:
"222222" - bu string ya'ni tekst

22222 - bu esa son. stringdan farqli o'laroq son ustida arifmetik amallar bajarsa bo'ladi.

6 endl

  • endl bu code oraqali yangi qatorga o'tiladi!
  • \n bu code orqali ham keyingi qatorga o'tsa bo'ladi, lekin bu tekstlar ichida ishlatiladi

7 ;

  • ; C++ da har bir ifodani oxiriga shu belgi qo'yiladi!

8 return 0;

  • return 0; bu code int main() funksiyasini Operatsion Sistemaga muvaffaqqiyatli yakunlanganligini bildiradi!

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

Top comments (0)

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