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.