C++ Yangi qator.

islomali99

islomAli99

Posted on February 21, 2023

C++ Yangi qator.

Assalamu aleykum xurmatli dasturchi bugungi o'rganadigon narsamiz C++ dasturlash tilida yangi qator tashlashni korib chiqamiz.
Yangi qator kiritish uchun "\n" belgisidan foydalanishingiz mumkin:

Misol uchun::

#include <iostream>
using namespace std;

int main()
{

cout << "Men C++ o'rganishni boshladim\n";
cout << "Judayam qiziqarli va o'rganishaga oson";

return 0;
}

Enter fullscreen mode Exit fullscreen mode

Maslahat: Bir-biridan keyin ikkita \n belgi boʻsh qator hosil qiladi:

Misol uchun::

#include <iostream>
using namespace std;

int main()
{

cout << "Sizga maslahatim dasturlashni C yoki C++ dan boshlang\n\n";
cout << "Qani kettik";

return 0;
}
Enter fullscreen mode Exit fullscreen mode

Yangi qatorni kiritishning yana bir yo'li "endl" maxsus buyurug'idan foydalanamiz:

Misol uchun::

#include <iostream>
using namespace std;

int main()
{

cout << "I am learning C++" << endl;
cout << "Salom Dunyo";

return 0;
}
Enter fullscreen mode Exit fullscreen mode

Satrlarni kesish uchun "\n" va "endl" ham ishlatiladi. Biroq, "\n" eng ko'p ishlatiladi.

Lekin \n aynan nima?
Yangi qator belgisi (\n) qochish ketma-ketligi deb ataladi va u kursorni o'z o'rnini ekrandagi keyingi qatorning boshiga o'zgartirishga majbur qiladi. Buning natijasida yangi qator paydo bo'ladi.

Boshqa haqiqiy qochish ketma-ketliklariga misollar:

Image description

💖 💪 🙅 🚩
islomali99
islomAli99

Posted on February 21, 2023

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

Sign up to receive the latest update from our blog.

Related

while, do-while and for loops in C++
beginners while, do-while and for loops in C++

March 7, 2024

If statements in C++
beginners If statements in C++

March 4, 2024

Operators and true folse .
beginners Operators and true folse .

March 14, 2023