C ++ ASSIGMENT OPERATOR HAQIDA .

Biz int ishorasiniga bitta son belgilab uni keyinchalik boshqa songa o’zgartirsak ham bo’ladi.Ya’ni o’sha soni ichiga boshqa son qo’yishimiz mumkin digani.Miaol uchun…

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

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


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

Biz int ishorasiniga bitta son belgilab uni keyinchalik boshqa songa o'zgartirsak ham bo'ladi.Ya'ni o'sha soni ichiga boshqa son qo'yishimiz mumkin digani.Miaol uchun...

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

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

 a = 20;
 ism = "kimsan";
 cout << a << endl;
  cout << ism;
  return 0;
}

int qilib a ni belgiladik.Yangi misol uchun bizga boshqa butun son kereak bo'lsa a = 20;qilib yozib ketsak bo'ladi.
Misolni teng ishorasidan kegn javobini qisqartirib yozishimiz ham mumkin.

 int a =5;
 int b = 6;

  b = b + a; // b += a;
 a + a - 10; // a-= 10;

 b*=;
 a /= b;
 cout << b; 
  return 0;
}

b = b + a; qilib yozganimizdan koraroq qisqaroq qilib ham tezro ishlashimiz uchun b += b; hudi shunaqa qib yozsak ham bo'ladi.
Bu kodda yangi bir ishora yaratishimiz mumkin.

#include <iostream>
#include <cmath>
using namespace std;
int main4 (){

  int a = 5;
 int b = 2;

  a += 5;

  cout << a << endl;
  b -= 3;
 cout << b;
  return 0;
}

@dawroun


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


Print Share Comment Cite Upload Translate Updates
APA

etibor2006 | Sciencx (2022-12-23T13:43:29+00:00) C ++ ASSIGMENT OPERATOR HAQIDA .. Retrieved from https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/

MLA
" » C ++ ASSIGMENT OPERATOR HAQIDA .." etibor2006 | Sciencx - Friday December 23, 2022, https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/
HARVARD
etibor2006 | Sciencx Friday December 23, 2022 » C ++ ASSIGMENT OPERATOR HAQIDA .., viewed ,<https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/>
VANCOUVER
etibor2006 | Sciencx - » C ++ ASSIGMENT OPERATOR HAQIDA .. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/
CHICAGO
" » C ++ ASSIGMENT OPERATOR HAQIDA .." etibor2006 | Sciencx - Accessed . https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/
IEEE
" » C ++ ASSIGMENT OPERATOR HAQIDA .." etibor2006 | Sciencx [Online]. Available: https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/. [Accessed: ]
rf:citation
» C ++ ASSIGMENT OPERATOR HAQIDA . | etibor2006 | Sciencx | https://www.scien.cx/2022/12/23/c-assigment-operator-haqida/ |

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.