DEV Community

Diyorbek
Diyorbek

Posted on

c++ 2 dars

operators
c++ operatorlar 6 hil boladi bular
(+) Qo'shish


#include <iostream>
using namespace std;
int main() {
  int x = 5;
  int y = 3;
  cout << x + y;
  return 0;
}
Enter fullscreen mode Exit fullscreen mode

(-) Ayirish

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  int y = 3;
  cout << x - y;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

(*) Ko'paytirish

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  int y = 3;
  cout << x * y;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

(/) Bo'lo'v

#include <iostream>
using namespace std;

int main() {
  int x = 12;
  int y = 3;
  cout << x / y;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

(%) foiz

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  int y = 2;
  cout << x % y;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

(++) Qo'sish

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  ++x;
  cout << x;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

(--) Kamaytirish

#include <iostream>
using namespace std;

int main() {
  int x = 5;
  --x;
  cout << x;
  return 0;
}

Enter fullscreen mode Exit fullscreen mode

Top comments (0)