Forem

JohnnySenior
JohnnySenior

Posted on

2

C++ dasturida kiritish operatori haqida

  • Assalomu alekum hurmatli o'quvchi. Demak bugun cin kiritish operatori haqida gaplashamiz. cin => bu (console input) ya'ni konsul oynaga(natija chiqadigan oyna) qiymat kiritishni bildiradi. Shu paytgacha konsul oynaga faqat qiymat chiqarib keldik bugun esa qiymat kiritishni o'rganamiz. cin kiritish operatori >> katta belgisi bilan doim birga keladi. Manabu tarzda cin>> doim birga yozishimiz shart. E'tibor bering misol bilan tushintirishga harakat qilaman.
#include <iostream>

using namespace std;

int main() {

  string ism="Jamshid";

  cout << ism;

  return 0;
}

Enter fullscreen mode Exit fullscreen mode

Mana e'tibor bering o'zgaruvchi avvaldan e'lon qilib bo'lingan string ism="Jamshid" tarzida. Va hech qanday cin>> operatori yo'q. Natija esa to'g'ridan to'g'ri konsul oynaga Jamshidbek shaklida chiqib keladi. Rasmga qarang

Image description

Endi cin>> operatoridan foydalanamiz va o'zgaruvchi avvaldan kiritilmaydi va u konsul oynada kiritiladi va biz hoxlagan ismni kiritishimiz mumkin.

#include <iostream>

using namespace std;

int main() {

  string ism;

  cout << "Ismingizni kiriting: ";
  cin >> ism;
  cout << "Sizning ismingiz: " <<ism;

  return 0;
}
Enter fullscreen mode Exit fullscreen mode

Endi natijaga qarang va oldigisi bilan solishtiring.

Image description
Mana dasturda bizdan konsul oynada ism kiritishimizni so'radi va biz kiritik natija esa biz kiritgan o'zgaruvchini chiqarib berdi. Bu maqolamiz qisqa lekin judayam muhim e'tibor bilan o'qishingizni va o'zingiz boshqa misollar ishlab ko'rishingizni tavsiya beraniz. E'tiboringiz uchun raxmat siz bilan
Jamshidbek Tursunboev bo'ldi.

@dawroun

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more

Top comments (0)

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more

👋 Kindness is contagious

Explore a sea of insights with this enlightening post, highly esteemed within the nurturing DEV Community. Coders of all stripes are invited to participate and contribute to our shared knowledge.

Expressing gratitude with a simple "thank you" can make a big impact. Leave your thanks in the comments!

On DEV, exchanging ideas smooths our way and strengthens our community bonds. Found this useful? A quick note of thanks to the author can mean a lot.

Okay