Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- using namespace std;
- void Mod(int* x) {
- if (*x < 0) {
- *x *= -1;
- }
- }
- int main() {
- int x = -5;
- Mod(&x);
- cout << x << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement