Lesson 3 of 24

cin మరియు getline తో Input

8 min 20 XP

cin >> x ఒక value ను space లేదా కొత్త లైన్ వరకు చదువుతుంది. 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.