Skip to content
This repository has been archived by the owner on Jun 16, 2023. It is now read-only.

Commit

Permalink
excercise
Browse files Browse the repository at this point in the history
  • Loading branch information
mc-cat-tty committed Sep 28, 2021
1 parent 3ede217 commit 1bb9239
Show file tree
Hide file tree
Showing 5 changed files with 50 additions and 0 deletions.
14 changes: 14 additions & 0 deletions esercitazioni/0_se_multiplo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
int a, b;
cout << "Inserisci primo numero intero positivo: ";
cin >> a;
cout << "Inserisci secondo numero intero positivo: ";
cin >> b;
cout << n%2 << endl;
return 0;
}
12 changes: 12 additions & 0 deletions esercitazioni/1_se_pos-1_se_neg.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
int a;
cout << "Inserisci numero intero: ";
cin >> a;
cout << a/abs(a) << endl;
return 0;
}
12 changes: 12 additions & 0 deletions esercitazioni/5_0_se_pari.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
int n;
cout << "Inserisci numero intero: ";
cin >> n;
cout << n%2 << endl;
return 0;
}
12 changes: 12 additions & 0 deletions esercitazioni/5_1_se_pari.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#include <iostream>
#include <cstdio>

using namespace std;

int main() {
int n;
cout << "Inserisci numero intero: ";
cin >> n;
cout << abs(n%2-1) << endl;
return 0;
}
Binary file modified esercitazioni/a.out
Binary file not shown.

0 comments on commit 1bb9239

Please sign in to comment.