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;
}
Top comments (0)