Answer to Question #318498 in C++ for peter

Question #318498

Write a program that prints all the uppercase characters of the ASCII character table. Display 5 characters per line. Characters are separated by exactly one space.



1
Expert's answer
2022-03-26T02:39:36-0400
#include<iostream>
using namespace std;

int main() {
    char ch='A';
    int i=0;
      while(ch !='Z') {
          cout<<ch<<' ';
          i++; ch++;
          if(i%5==0){
              cout<<endl;
          }
      }
        
    cout << endl;
    return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog