Problem: Write a program that uses a loop to display the characters for each ASCII code 32 through 127. Display 16 characters on each line with one space between characters.
I have tried solving this problem several ways. I either get blank screen or numbers 1-16. Can anyone lend a hand please?
This is what I got so far
#include <iostream>
using namespace std;
int main()
{
int num = 0;
char letter;
while (num <= 16)
{
letter = 32;
cout << letter << " " << endl;
num++;
}
return 0;
}
tried:
#include <iostream>
using namespace std;
int main()
{
int num = 0;
char letter;
while (num <= 16)
{
letter = 32;
cout << num << " " << endl;
num++;
}
return 0;
}