SSC IMD SA 2017 – Question 200

Question:

What does the escape code \a represent?

एस्केप कोड क्या दर्शाता है?

Options:

  • Alert
  • Backslash
  • Tab
  • Form feed
  • चेतावनी
  • बैकस्लैश
  • टैब
  • फ़ीड बनाएं

Correct Answer: a)

Explanation:

Detailed Explanation:

The correct answer is a) Alert / Warning (चेतावनी).

In C, C++, and related programming languages, escape sequences are character combinations consisting of a backslash (\) followed by a letter or digits, used to represent non-printable control characters:

  • \a: Alert / Bell (चेतावनी बीप): Generates an audible warning sound (beep) or a visual alert on supported terminal hardware and operating systems (ASCII decimal value 7).
  • \\: Backslash (बैकस्लैश): Prints a literal backslash character.
  • \t: Horizontal Tab (टैब): Advances the cursor to the next horizontal tab stop.
  • \f: Form Feed (फ़ीड बनाएं / फॉर्म फीड): Advances the printer or display to the beginning of the next page/form.
  • \n: Newline: Moves the cursor to the beginning of the next line.
  • \b: Backspace: Moves the cursor back by one position.
  • \r: Carriage Return: Returns the cursor to the beginning of the current line.

Therefore, the escape sequence \a represents an Alert / Bell (चेतावनी).

विस्तृत व्याख्या:

सही उत्तर a) चेतावनी (Alert / Bell) है।

C और C++ प्रोग्रामिंग भाषाओं में, एस्केप अनुक्रम (Escape Sequences) विशिष्ट नियंत्रण वर्णों को दर्शाने के लिए बैकस्लैश (\) के साथ प्रयुक्त होते हैं:

  • \a: अलर्ट / चेतावनी (Alert / Bell): यह सिस्टम स्पीकर के माध्यम से एक श्रव्य बीप (ध्वनि) या चेतावनी संकेत उत्पन्न करता है (ASCII मान 7)।
  • \\: बैकस्लैश: वास्तविक बैकस्लैश वर्ण को प्रिंट करता है।
  • \t: टैब (Horizontal Tab): कर्सर को अगले टैब स्थान पर ले जाता है।
  • \f: फॉर्म फीड (फ़ीड बनाएं): प्रिंटर या स्क्रीन को अगले पृष्ठ के आरंभ में ले जाता है।
  • \n: नई लाइन (Newline): कर्सर को अगली पंक्ति में भेजता है।

अतः एस्केप कोड \a एक चेतावनी (Alert/Bell) का प्रतिनिधित्व करता है।

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top