Lesson 3 of 23

scanf() দিয়ে Input পড়া

8 min 20 XP

scanf() ব্যবহারকারীর কাছ থেকে values পড়ে। Variable-এর নামের আগে & (address-of) দিন যাতে scanf তাতে লিখতে পারে। double পড়তে %lf ব্যবহার করুন।

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

Example: edit me and press Run

Output Loading C (first time takes a few seconds)
Press Run to see the result here.

String (char array) পড়তে & লাগে না, কারণ array-র নাম নিজেই একটি address। %s কেবল একটি শব্দ পড়ে, space পর্যন্ত।

Challenge

+20 XP

বৃত্তের ব্যাসার্ধ (একটি double) পড়ে তার ক্ষেত্রফল 2 দশমিক স্থান পর্যন্ত print করুন। PI = 3.14159 নিন। Input: 2 → Output: 12.57

Output Loading C (first time takes a few seconds)
Press Run to see the result here.