Ask your own question, for FREE!
Computer Science 25 Online
OpenStudy (anonymous):

i need help with this problem writing it in C++: Characters for the ASCII codes, Write a program that uses a loop to display the characters for the ASCII codes 0 through 127. Display 16 characters each line.

OpenStudy (anonymous):

You need either an int or char variable that goes from 0 to 127 and print it as a %c. Use a for, something like: for(i=0; i <= 127; i++){ if(i % 16 == 0){ //print the character and a \n i%16 will make it so everytime you reach 16, 32, 48, etc. you will ujmp a line. } else { //just print the character } } the variable i will go through all the values from 0 to 127 in this for.

OpenStudy (anonymous):

I think it's a little cleaner to always print the character, then if i%16==0 print just a newline.

OpenStudy (rsmith6559):

One thing, the ASCII values below 32 are mostly control "characters" printing them can give some REAL interesting results.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
somnium: testing rq
2 hours ago 1 Reply 0 Medals
Lilmunchin: Trump or Biden
6 minutes ago 70 Replies 3 Medals
ARTSMART: Art!
4 hours ago 5 Replies 5 Medals
Jasonisyours: What were the key causes of the French Revolution in 1789?
4 hours ago 3 Replies 5 Medals
PureSoulless: Why is the word "Pedophile" always censored in yt vids?
1 day ago 3 Replies 0 Medals
Jalli: What's 58x3634u00b07
1 day ago 6 Replies 3 Medals
arriya: who wanna play roblox
1 day ago 5 Replies 1 Medal
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!