fork download
  1. #include <iostream>
  2. #include <cstdlib> // Needed for rand() and srand()
  3. #include <ctime> // Needed for time()
  4. using namespace std;
  5.  
  6. int main() {
  7. // your code goes here
  8. srand(time(0));
  9. int random = rand() % 101;
  10. cout<<"number is "<<random<<endl;
  11. if(random > 50){
  12. cout<<random<<" "<<"is > than 50"<<endl;
  13. } else if (random < 50) {
  14. cout<<random<<" is < than 50"<<endl;
  15. }else{
  16. cout<<random<<"=50"<<endl;
  17. }
  18.  
  19.  
  20. return 0;
  21. }
Success #stdin #stdout 0.01s 5264KB
stdin
Standard input is empty
stdout
number is  46
46 is < than 50