Lesson 3 of 23
scanf() மூலம் InputReading Input with scanf()
8 min 20 XP
scanf() user-இடமிருந்து மதிப்புகளைப் படிக்கும். Variable பெயருக்கு முன் & (address) போட வேண்டும், இதனால் scanf அந்த variable-ல் மதிப்பை எழுத முடியும். double படிக்க %lf பயன்படுத்துங்கள்.
scanf() reads values from the user. Put & (address-of) before the variable name so scanf can write into it. Use %lf to read a double.
Example: edit me and press Run
Press Run to see the result here.Example: edit me and press Run
Press Run to see the result here.String (char array) படிக்கும்போது & தேவையில்லை, ஏனெனில் array பெயரே ஒரு address. %s ஒரு சொல்லை மட்டுமே (space வரை) படிக்கும்.
Reading a string (char array) needs no &, because an array's name is already an address. %s reads only one word, up to a space.