fork download
  1. #include <iostream> // Preprocessor directive for cin and cout
  2. using namespace std;
  3.  
  4. double user_start, user_end; // Variables for user input
  5. int i;
  6.  
  7. cout << "Enter a starting number and an ending number from 0-9." << endl; // Ask user for two values
  8. cin >> user_start >> user_end >> endl;
  9.  
  10. if (start < 0 || end > 10) // Trying make it so only positve values are allowed
  11. {
  12. cout << "Enter a positive number" << endl;
  13. cin >> user_start >> user_end >> endl;
  14. }
  15. if else
  16. {
  17. cout << "No more chances" << endl; // Only giving the user one chance to correct his/her mistake
  18. }
  19.  
  20.  
  21. for (int i = 0; start <= end; i = i+1) // The plan is for the outer for loop to calculate the number of rows
  22. {
  23. for (int j = 1; j = i; j++) // The inner for loop calculates how many times i will be printed i.e. 1 once 9 nine times
  24. {
  25. cout << "start is 'user_start', " << "end is 'user_end': " << endl;
  26. }
  27. }
  28.  
  29. return 0; // End program
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cpp:7: error: expected constructor, destructor, or type conversion before ‘<<’ token
prog.cpp:8: error: expected constructor, destructor, or type conversion before ‘>>’ token
prog.cpp:10: error: expected unqualified-id before ‘if’
prog.cpp:15: error: expected unqualified-id before ‘if’
prog.cpp:21: error: expected unqualified-id before ‘for’
prog.cpp:21: error: expected constructor, destructor, or type conversion before ‘<=’ token
prog.cpp:21: error: expected constructor, destructor, or type conversion before ‘=’ token
stdout
Standard output is empty