#include<iostream>
#include<iomanip>
usingnamespace std;
int main() {
int lower, upper, count = 0;
cout << "Enter lower and upper values";
scanf("%d", &lower);
scanf("%d", &upper);
//this loop will continue till user enters a valid input
while (lower < 32 || upper > 126 || lower > upper) {
cout << "\nValues must be in range 32 to 126 inclusive";
cout << "\nEnter lower and upper values";
//read data again
scanf("%d", &lower);
scanf("%d", &upper);
}
cout << "\nCharacters for ASCII values between " << lower << " and " << upper;
cout << "\n----+----+----+-\n";//prints the line
for (; lower <= upper; lower++) {
//print a character
printf("%c", lower);
count++;
//check if we have already printed 16 characters
if (count == 16) {
cout << endl;
count = 0;
}
}
cout << "\n----+----+----+-\n";//prints the lines
return 0;
}
**When I input these values: 90 121
Below is my ouput, but is is not correct because it has that big space between the characters and the line.
Enter lower and upper values
Characters for ASCII values between 90 and 121
----+----+----+-
Z[\]^_`abcdefghi
jklmnopqrstuvwxy
//<--this the big space that is making my coding incorrect
----+----+----+-
**Below is what my ouput should look like:
Enter lower and upper values
Characters for ASCII values between 90 and 121
----+----+----+-
Z[\]^_`abcdefghi
jklmnopqrstuvwxy
----+----+----+-
**If you could fix my coding so my output is correct, thanks.