1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16using namespace std; #include <iostream> #include <cstdlib> #include <ctime> int main() { srand(time(0)); int x = rand()% 100 + 1; if (x % 2 ==0){ cout << x << " Is Even"; } else { cout << x << " Is Odd"; } };
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
using namespace std; #include <iostream> #include <cstdlib> #include <ctime> int main() { srand(time(0)); int x = rand()% 100 + 1; if (x % 2 ==0){ cout << x << " Is Even"; } else { cout << x << " Is Odd"; } };