Incremaent/decrement Operator

abror07

Abror_7

Posted on January 10, 2023

Incremaent/decrement Operator

Increment/Decrement operatorlari o'zgaruvchini bitta oshirib berish yoki kamaytirib berish . a++,++a,b++,++b,a--,--a,b--,--b.

  • Agar ++,-- a yoki boshqa o'zgaruvchilardan oldin kelsa unda o'sha qatordan boshlab hamma pastki qatorlarda o'sha o'zgaruvchi bitta songa oshadi yoki kamayadi.

#include <iostream>
using namespace std;
int main (){
  int a = 67;
  int z = 16;
  int c = --a + z++;
  cout << c;
return 0;
}
Enter fullscreen mode Exit fullscreen mode
  • Agar ++,-- a yoki boshqa o'zgaruvchilardan keyin kelsa unda pastki qatordan boshlab o'zgaruvchi birga oshadi yoki kamayadi.

#include <iostream>
using namespace std;
int main (){
  int a = 67;
  int z = 16;
  int g = a++ + z++;
  cout << g;
return 0;
}
Enter fullscreen mode Exit fullscreen mode

@dawroun

💖 💪 🙅 🚩
abror07
Abror_7

Posted on January 10, 2023

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

Sign up to receive the latest update from our blog.

Related