DEV Community

Cover image for C++ Yangi qator.
islomAli99
islomAli99

Posted on

2

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

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 (1)

Collapse
 
zafar7709 profile image
zafar7709

Ok

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

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

Okay