Please can someone explain what each line of code below will do | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

Please can someone explain what each line of code below will do

Begin Set int count = 0, int sum=0 While count < 5 Get a number Add number to sum Add 1 to count End while Print sum End

2nd Dec 2022, 4:41 AM
Jaimz
Jaimz - avatar
2 Respuestas
+ 8
This is not real code, it is pseudocode. It only describes the algorithm what the program should follow. It IS the explanation itself.
2nd Dec 2022, 5:28 AM
Tibor Santa
Tibor Santa - avatar
0
You'll probably get some negative feedback for this one. It's cool though. We all start somewhere. In regard to coding, I'm a beginner myself. The way your question will be interpreted by some is that you are passing your effort off on to them. I'm sure that's not what you're trying to do. It's just how it can be interpreted by some. Though, I think some people often forget how painful searching for answers online can be. Simple questions are usually answered with complex explanations that make no sense to a beginner like us. Two things I can recommend for the future: - Narrow down a problem as much as possible before asking for help - Be as specific as possible when asking for help In regard to narrowing down, what part of the code don't you understand? Do you know what "set" does? Do you know what a "while loop" is? If not, your next step should be to research and understand these specific concepts. Then if you get stuck, you'll have a specific question that people can help you with. For somebody to properly answer the general question of "what does each line of code do," they would have to explain variables, while loops, printing to console, etc. So you just need to be more specific. That's all. The lessons here should cover every aspect of your question above.
3rd Dec 2022, 4:17 PM
Ken S
Ken S - avatar