answersLogoWhite

0

Getchar:-Reading a single character can be done by using the function getchar.

Syntax:- variable_name = getchar ( );

Variable_name is a valid 'c' name that has been declared as char type. When this statement is encountered, the computer waits until a key is pressed and then assigns this character as a value to getchar function. Since getchar is used on the right hand side of an assignment statement, the character value of getchar is in turn assigned to the variable_name on the left. The getchar function may be called successively to read the characters contained in a line of text. Getchar accepts space character.

Scanf ("control strings",arg1, arg2, ………… argn);

The control string specifies the field format in which the data is to be entered and the arguments arg 1, arg 2, arg n specify the address of locations where the data is stored. Scanf does not accept space character.

User Avatar

Wiki User

7y ago

Still curious? Ask our experts.

Chat with our AI personalities

ReneRene
Change my mind. I dare you.
Chat with Rene
JudyJudy
Simplicity is my specialty.
Chat with Judy
ViviVivi
Your ride-or-die bestie who's seen you through every high and low.
Chat with Vivi

Add your answer:

Earn +20 pts
Q: How Can We Solve The Limitation Of Getchar And Scan Function?
Write your answer...
Submit
Still have questions?
magnify glass
imp