c++ 2 dars
Diyorbek
Posted on June 7, 2024
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;
}
(-) Ayirish
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 3;
cout << x - y;
return 0;
}
(*) Ko'paytirish
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 3;
cout << x * y;
return 0;
}
(/) Bo'lo'v
#include <iostream>
using namespace std;
int main() {
int x = 12;
int y = 3;
cout << x / y;
return 0;
}
(%) foiz
#include <iostream>
using namespace std;
int main() {
int x = 5;
int y = 2;
cout << x % y;
return 0;
}
(++) Qo'sish
#include <iostream>
using namespace std;
int main() {
int x = 5;
++x;
cout << x;
return 0;
}
(--) Kamaytirish
#include <iostream>
using namespace std;
int main() {
int x = 5;
--x;
cout << x;
return 0;
}
💖 💪 🙅 🚩
Diyorbek
Posted on June 7, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.