Lesson 3 of 24

cin और getline से Input

8 min 20 XP

cin >> x space या नई लाइन तक एक value पढ़ता है। Spaces वाली पूरी लाइन के लिए 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.