Saved Bookmarks
| 1. |
Explain GETS() and PUTS() function with example. |
|
Answer» GETS( ): In ‘C’ scanf( ) is not capable of receiving a multiword string, therefore, names such as “Rajeev Sharma” would be unacceptable. The function collects a string of characters terminated by a new line, the standard input. PUTS(): The function puts() can display only one string at a time. Puts copies the nullterminated string to the standard output. Also on display a string, unlike printf(), puts() places the cursor on the next line. Example: void main() Output: Enter your name, Rajeev Sharma Good Morning Rajeev Sharma. |
|