DEV Community

Abror_7
Abror_7

Posted on

assigment operator haqida;

Tenglik belgisi = bu belgi replitda int,stringfloatvachardan keyin kelgan belgi bilan tenglik belgisidan keyin kelganbutun son ,text(matn), kasr , belgilarni tenglashtirib beradi.

  int a = 10 ;
Enter fullscreen mode Exit fullscreen mode
 float PI = 3.14;
  float r = L/(2*PI);
  float S = PI * (r*r);
Enter fullscreen mode Exit fullscreen mode

  string ism = "davron";

Enter fullscreen mode Exit fullscreen mode

assignment operator
biz yozgan ko'dlarni qisqartirib yozib beradi.

b = b + a; //b += a;
b = b - a; //b -= a; 
b = b / a; //b /= a;
b = b * a; //b *= a;
Enter fullscreen mode Exit fullscreen mode

Biz yozgan o'zgaruvchilarni keyinchalik ham o'zgartirsa bo'ladi.

#include <iostream>
#include <cmath>
using namespace std;
int main (){
  int a = 7;
  string ism = "Abror";

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

  a = 10;
  ism = "Sardor";
  cout << a << endl;
  cout << ism;

return 0;
}
Enter fullscreen mode Exit fullscreen mode

@dawroun

Top comments (1)

Collapse
 
dawroun profile image
Davron

zo'r