fork download
  1. //@Author Damien Bell
  2. #include <iostream>
  3. #include <cmath>
  4. using namespace std;
  5. int main(){
  6. int choice=0;
  7. double x, y, z=0;
  8.  
  9. cout << "Enter a number between 1 and 25: ";
  10. cin >>choice;
  11.  
  12. if(choice > 10){
  13. cout <<"Number is > 10\n";
  14. if (choice > 20){
  15. cout <<" Number is greater than 20\n";
  16. if (choice >20 && choice <25){
  17. cout << "Number is greater than 20. And <25 \n";
  18. }
  19. else{
  20. //null
  21. }
  22. }
  23. else {
  24. //null
  25. }
  26. }
  27. else {
  28. //null
  29. }
  30.  
  31.  
  32.  
  33.  
  34.  
  35. return 0;
  36. }
stdin
21
compilation info
prog.cpp: In function ‘int main()’:
prog.cpp:7: warning: unused variable ‘x’
prog.cpp:7: warning: unused variable ‘y’
prog.cpp:7: warning: unused variable ‘z’
stdout
Enter a number between 1 and 25: Number is > 10
 Number is greater than 20
Number is greater than 20. And <25