LESSON 13 OF 52 · CHAPTER 01
Comments
// line comments, strings containing comment markers and whitespace between tokens
13-comments.srp
// Comments and whitespace may separate tokens.
println // statement name
(
"// inside a string is text"
)
;
print(""); // An empty string still writes a newline.
print("done");
stdout
// inside a string is text
done
Write what you expect this program to print. Check prediction for a line-level hint without revealing the answer, or reveal the verified output when ready. This checks displayed text only; it does not run Scarp or save your input.
UNDERSTAND THE CODE
Explanation & practice
What this example teaches
// line comments, strings containing comment markers and whitespace between tokens
Expected behavior
// inside a string is text, blank line, then done
Practice: Read the source before looking at the output. Predict the values and their order, then use the pinned compiler to execute this lesson and compare the exact fixture. Identify which operation produces the result.
टिप्पणियाँ और खाली स्थान
// एक लाइन की टिप्पणी आरम्भ करता है, लेकिन उद्धरण के भीतर "// inside a string is text" साधारण टेक्स्ट है। इस उदाहरण में println और अगले ( के बीच टिप्पणी व नई लाइन है; पिन किए गए कम्पाइलर में यह मान्य है। खाली स्ट्रिंग का print एक खाली आउटपुट लाइन बनाता है।
आउटपुट: पहले // inside a string is text, फिर खाली लाइन, फिर done।
अभ्यास: फ़ाइल में किस // से टिप्पणी शुरू होती है, और कौन-सा // स्ट्रिंग का हिस्सा है?
Explanations are sourced from the project's English chapter guide and हिन्दी अध्याय. The Scarp program and output are unchanged.
LEARNING PROGRESS
Keep your place
Mark this lesson complete when you are ready.
Only saved in this browser. No account or tracking.
TRY IT LOCALLY
Verify, then execute
Use the pinned compiler from the course root. Keep any imported _support files next to the source.
scarp verify examples/01-basics/13-comments.srp
scarp exec examples/01-basics/13-comments.srpThe website does not run code. Read the CLI guide ↗
Pinned compiler: Scarp v0.0.6-alpha.3
· ceff07d9014f. No simulated output.