#include <iostream> // Preprocessor directive for cin and cout
using namespace std;
double user_start, user_end; // Variables for user input
int i;
cout << "Enter a starting number and an ending number from 0-9." << endl; // Ask user for two values
cin >> user_start >> user_end >> endl;
if ( start < 0 || end > 10 ) // Trying make it so only positve values are allowed
{
cout << "Enter a positive number" << endl;
cin >> user_start >> user_end >> endl;
}
if else
{
cout << "No more chances" << endl; // Only giving the user one chance to correct his/her mistake
}
for ( int i = 0 ; start <= end; i = i+ 1 ) // The plan is for the outer for loop to calculate the number of rows
{
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
{
cout << "start is 'user_start', " << "end is 'user_end': " << endl;
}
}
return 0 ; // End program
I2luY2x1ZGUgPGlvc3RyZWFtPgkJLy8gUHJlcHJvY2Vzc29yIGRpcmVjdGl2ZSBmb3IgY2luIGFuZCBjb3V0CnVzaW5nIG5hbWVzcGFjZSBzdGQ7Cgpkb3VibGUgdXNlcl9zdGFydCwgdXNlcl9lbmQ7CS8vIFZhcmlhYmxlcyBmb3IgdXNlciBpbnB1dAppbnQgaTsgCgpjb3V0IDw8ICJFbnRlciBhIHN0YXJ0aW5nIG51bWJlciBhbmQgYW4gZW5kaW5nIG51bWJlciBmcm9tIDAtOS4iIDw8IGVuZGw7CS8vIEFzayB1c2VyIGZvciB0d28gdmFsdWVzIApjaW4gPj4gdXNlcl9zdGFydCA+PiB1c2VyX2VuZCA+PiBlbmRsOwoKaWYgKHN0YXJ0IDwgMCB8fCBlbmQgPiAxMCkJCS8vIFRyeWluZyBtYWtlIGl0IHNvIG9ubHkgcG9zaXR2ZSB2YWx1ZXMgYXJlIGFsbG93ZWQKewoJY291dCA8PCAiRW50ZXIgYSBwb3NpdGl2ZSBudW1iZXIiIDw8IGVuZGw7CgljaW4gPj4gdXNlcl9zdGFydCA+PiB1c2VyX2VuZCA+PiBlbmRsOyAKfQppZiBlbHNlCnsKCWNvdXQgPDwgIk5vIG1vcmUgY2hhbmNlcyIgPDwgZW5kbDsJLy8gT25seSBnaXZpbmcgdGhlIHVzZXIgb25lIGNoYW5jZSB0byBjb3JyZWN0IGhpcy9oZXIgbWlzdGFrZQp9CgoKZm9yIChpbnQgaSA9IDA7IHN0YXJ0IDw9IGVuZDsgaSA9IGkrMSkJLy8gVGhlIHBsYW4gaXMgZm9yIHRoZSBvdXRlciBmb3IgbG9vcCB0byBjYWxjdWxhdGUgdGhlIG51bWJlciBvZiByb3dzCnsKCWZvciAoaW50IGogPSAxOyBqID0gaTsgaisrKQkJLy8gVGhlIGlubmVyIGZvciBsb29wIGNhbGN1bGF0ZXMgaG93IG1hbnkgdGltZXMgaSB3aWxsIGJlIHByaW50ZWQgaS5lLiAxIG9uY2UgOSBuaW5lIHRpbWVzCgl7CQoJCWNvdXQgPDwgInN0YXJ0IGlzICd1c2VyX3N0YXJ0JywgIiA8PCAiZW5kIGlzICd1c2VyX2VuZCc6ICIgPDwgZW5kbDsKCX0KfQoKcmV0dXJuIDA7CS8vIEVuZCBwcm9ncmFt
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