Lesson 3 of 24

cin এবং getline দিয়ে Input

8 min 20 XP

cin >> x space বা নতুন লাইন পর্যন্ত একটি value পড়ে। Space সহ পুরো লাইনের জন্য getline(cin, s) নিন। cin >>-এর পরে getline-এর আগে cin.ignore() call করুন যাতে বাকি থাকা newline বাদ যায়।

Example: edit me and press Run

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

Challenge

+20 XP

একটি Celsius তাপমাত্রা (double) পড়ে 1 দশমিক স্থান পর্যন্ত Fahrenheit-এ print করুন (F = C × 9 / 5 + 32)। Input: 37 → Output: 98.6

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