C++ da ASSIGMENT OPERATORI haqida ma’lumot.

biz c++ da bugungi darsimiz ASSIGMENT OPERATOR ni o’rgandik.
biz int ishorasi bilan 1 ta son belgilab, uni keyinchali o’zgartirsak ham bo’ladi.
unga misol:

int a = 10;
string ism = “rahima”;

cout << a << endl;
cout << ism &l…


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by feyyame1

biz c++ da bugungi darsimiz ASSIGMENT OPERATOR ni o'rgandik.
biz int ishorasi bilan 1 ta son belgilab, uni keyinchali o'zgartirsak ham bo'ladi.
unga misol:

int a = 10;
  string ism = "rahima";

  cout << a << endl;
  cout << ism << endl;

  a = 20;
  ism = "kimsan";
  cout << a << endl;
  cout << ism;

}

biz int bilan ishlaganda -+ ni +- ; /* ni */ ga o'zgatirsak ham bo'ladi .

int a = 5;
int b = 6;
b = b+ a; // b +=a;
a = a- 10; // a -=10;

b*=3; // b = b * 3;
a /= b; // a = a / b;
cout << b;
}

masala uchun: biz doiraning yuzini olsak,

Doiraning uzunligi sifatida bittakasr-sonNni o'qiymiz. Shu doirani yuzini topib va natijani nuqtadan keyin 0 ta aniqlikda chop etamiz.

Ď€ ning qiymati:3.14
Raduisi r bo'lgan doiraning uzunligi: L = 2Ď€r bizda r no'malum sonni topishimiz kerak.
Doiraning yuzi formulasi: S = πr^2
MASALANI javobi:

int main 2() {
double L;
  cin >> L;
  float PI = 3.14;
  float r = L/(2*PI);
  float S= PI * (r * r);
  cout << round(S);
return 0;

  }

biz bugun assigment operatori haqida ilk malumotni egalladik.
bunda birinchi navbatda int a da a ni yani biron sonni oqib olishimiz zarur.

int a = 10;
  string ism = "rahima";

va biron bir soz kiritishimiz kerak.
biz int a da yozgan sonimiz va harifimiz masalan son bo'ladigon bo'lsa, (10) buni biz osha qismda 1 marta ishlatsak bo'ladi!!!

@dawroun


This content originally appeared on DEV Community 👩‍💻👨‍💻 and was authored by feyyame1


Print Share Comment Cite Upload Translate Updates
APA

feyyame1 | Sciencx (2022-12-23T13:54:36+00:00) C++ da ASSIGMENT OPERATORI haqida ma’lumot.. Retrieved from https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/

MLA
" » C++ da ASSIGMENT OPERATORI haqida ma’lumot.." feyyame1 | Sciencx - Friday December 23, 2022, https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/
HARVARD
feyyame1 | Sciencx Friday December 23, 2022 » C++ da ASSIGMENT OPERATORI haqida ma’lumot.., viewed ,<https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/>
VANCOUVER
feyyame1 | Sciencx - » C++ da ASSIGMENT OPERATORI haqida ma’lumot.. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/
CHICAGO
" » C++ da ASSIGMENT OPERATORI haqida ma’lumot.." feyyame1 | Sciencx - Accessed . https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/
IEEE
" » C++ da ASSIGMENT OPERATORI haqida ma’lumot.." feyyame1 | Sciencx [Online]. Available: https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/. [Accessed: ]
rf:citation
» C++ da ASSIGMENT OPERATORI haqida ma’lumot. | feyyame1 | Sciencx | https://www.scien.cx/2022/12/23/c-da-assigment-operatori-haqida-malumot/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.