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.