C++ da cout(chiqarish) operatori

sherzod5048

Sherzod5048

Posted on September 9, 2022

C++ da cout(chiqarish) operatori

Assalomu alaykum!
Biz bu maqola orqali c++ dasturlash tilidagi cout operatori haqida bilib olamiz.cout operatori orqali biz consolda ixtiyoriy malumotlarni chiqarishimiz mumkun.Matnli malumotlarni chiqarishda doimo qoshtirnoqlardan ("") foydalanishimiz zarur:

1   #include <iostream>
2   using namespace std;
3   
4   int main() {
5
6      cout << "Hello world" << endl;
7      return 0;
8   }
Enter fullscreen mode Exit fullscreen mode

Programmada klaviatura orqali malumot kiritishimiz va chiqarishimiz uchun 1-qatordagi #include <iostream>ni programmamizga qoshishimiz kerak.
2-qatorda turgan using namespace std; ni standart nomlar fazosini elon qilish deb tushunsak boladi va xar bir dasturimiz bitta main(4-qator) ga ega bolishi shart.Biz kodlarimizni ochib-yopilgan figurali qavslarimiz ichiga yozamiz

4   int main() {
5
6      cout << "Hello world" << endl;
7      return 0;
8   }
Enter fullscreen mode Exit fullscreen mode

Biz hozir bilib olgan cout operatorimiz consoleda Hello world degan yozuvni chiqarib bermoqda.

C++ da sharhlar

1   // Muallif: Jumayev Sherzod
2   /* Sana: 2022.09.09
3       Maqsadim: C++ dasturlash tilini o`rganish */
4
5   #include <iostream>
6   using namespace std;
7   
8   int main() {
9
10      cout << "Hello world" << endl;
11      return 0;
12  }
Enter fullscreen mode Exit fullscreen mode

// va // belgilar bilan yozilingan qator C++ da sharxlar deyiladi.// bu belgi bilan boshlangan sharh faqat 1 qator sharh yozish imkoni beradi, 2-qatordagi // bunday belgilar bilan esa biz koproq qator sharh yozish imkoniga ega bolamiz.
Sharhlar - faqatgina dasturchilargagina korinadi va dasturda hech qanday vazifa bajarmaydi!Sharhlar bizga yozilgan kodlarni osongina tushunish imkonini beradi va ayniqsa katta praektlarda koplab dasturchilar team bolib ishlashadi, shu holatda dasturchilar faqatgina ozlarining kodlarini emas boshqa bir dasturchilarning ham kodlarini oqishga togri keladi.Shunda sharhlar dasturchilarga boshqa bir kodni osongina tushunish imkoni beradi.

💖 💪 🙅 🚩
sherzod5048
Sherzod5048

Posted on September 9, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related

setw() va setfill()
cpp setw() va setfill()

November 1, 2024

Variables & Data types
cpp Variables & Data types

October 29, 2024

Dasturlash
cpp Dasturlash

October 29, 2024

Conditional operator.
cpp Conditional operator.

October 31, 2024