assigment operator haqida;

abror07

Abror_7

Posted on December 23, 2022

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

πŸ’– πŸ’ͺ πŸ™… 🚩
abror07
Abror_7

Posted on December 23, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related