Loading Page Content...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Preparing courses, live labs, and learning resources.सामग्री लोड हो रही है, कृपया प्रतीक्षा करें...
Input and output operations are how your program communicates with the user. In C, standard input and output are provided by the <stdio.h> library via two central functions: printf() and scanf().
printf()printf() sends formatted text to the standard output terminal (stdout).
scanf()scanf() reads formatted data from the keyboard (stdin).
&) operator before non-pointer variables so scanf knows where to write in memory!Escape sequences are special character combinations prefixed with a backslash (\):
| Sequence | Name | Description |
|---|---|---|
\n | Newline | Moves the cursor to the beginning of the next line. |
\t | Horizontal Tab | Skips forward to the next tab stop (typically 4 or 8 spaces). |
\\ | Backslash | Prints an actual backslash character. |
\" | Double Quote | Prints a double quotation mark inside a string literal. |
\b | Backspace | Moves the cursor back one character space. |
\r | Carriage Return | Moves the cursor to the start of the current line. |
scanf("%d", &x)?- A) To tell C it is a constant - B) To pass the variable's memory address (Correct) - C) To format the text - D) To prevent memory leaks
- A) \t - B) \r - C) \n (Correct) - D) \a
Continue learning with hands-on practice, examples, and exercises in the upcoming topic.
Test your understanding of this lesson with 1 questions. Each question has one correct answer.