Lesson 3 of 24

cin आणि getline ने Input

8 min 20 XP

cin >> x space किंवा नवीन ओळीपर्यंत एक value वाचतो. Spaces असलेल्या संपूर्ण ओळीसाठी getline(cin, s) वापरा. cin >> नंतर getline पूर्वी उरलेला newline वगळण्यासाठी cin.ignore() call करा.

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.