- 3

Here is a quiz. The program needs for output the numbers 1 to 9, each on a separate line, followed by a dot: You can use the \n

Quiz

4th Oct 2022, 10:50 AM
Raymond Kazungu
14 Answers
+ 4
For some more clarity.. Raymond Kazungu Replace "" by " Remove space after digit And add dot after digit.
5th Oct 2022, 12:48 PM
Jayakrishna🇮🇳
Jayakrishna🇮🇳 - avatar
+ 2
A little typo in your post: The word "homework" is written h-o-m-e-w-o-r-k you wrote it q-u-i-z
4th Oct 2022, 1:25 PM
Oma Falk
Oma Falk - avatar
+ 1
"Don't post your homework If you post your homework with the aim of having others to do it for you, you'll end up with a pile of Down votes. It's okay to ask for hints, but not for entire solutions. Those questions are for you to work out, so you can learn from the experience." - Sololearn With that said: Please provide the programming language and your attempt.
4th Oct 2022, 3:41 PM
Chris Coder
Chris Coder - avatar
+ 1
I attempted this way; print(""1 \n2 \n3 \n4, \n5 \n6 \n7 \n8 \n9"") , but I am getting syntax error.
5th Oct 2022, 4:52 AM
Raymond Kazungu
+ 1
Raymond Kazungu it is not a serious error. Watch your "" ! Replace it by ".
5th Oct 2022, 5:36 AM
Oma Falk
Oma Falk - avatar
+ 1
You have an extra ( " ) and you didn't include the ( . ) after each number Also you have a stranded ( , ) remove that as well. Try this all on same line. print("1. \n2. \n3. \n4. \n5. \n6. \n7. \n8. \n9.")
5th Oct 2022, 3:05 PM
Chris Coder
Chris Coder - avatar
0
Hi, this is the Q&A section, here you can ask programming related questions and get help with code. What is your question? What have you tried so far?
4th Oct 2022, 10:56 AM
Lisa
Lisa - avatar
0
My question is; I am required to make a program that needs to output the numbers 1 to 9, each on a separate line, followed by a dot: such that 1. 2. 3. So how do I go about it?
4th Oct 2022, 12:00 PM
Raymond Kazungu
0
What is your attempt? Lesson explains print() function is it used to display output in a line.. You can add by using '\n' in between strings.. So "what had you tried so far..?"
4th Oct 2022, 12:14 PM
Jayakrishna🇮🇳
Jayakrishna🇮🇳 - avatar
0
I did c++ and l got it . You can used same approach to do it. And this is my code. Int a =10; for (int b = 1; b<a; b++) { cout << b << ".\n" << endl; }
5th Oct 2022, 2:03 PM
GODFRED TAWIAH
GODFRED TAWIAH - avatar
0
Meaning you have to use ".\n"
5th Oct 2022, 2:04 PM
GODFRED TAWIAH
GODFRED TAWIAH - avatar
0
I did that in C++ and it worked that was why l expressed my idea on that.
5th Oct 2022, 3:30 PM
GODFRED TAWIAH
GODFRED TAWIAH - avatar
0
You must carefully view the codes l provided. You see (.) Infront of ".\n"
5th Oct 2022, 3:32 PM
GODFRED TAWIAH
GODFRED TAWIAH - avatar
0
Raymond Kazungu Did you complete your assignment?
6th Oct 2022, 7:24 PM
Chris Coder
Chris Coder - avatar