Lesson 2 of 24

Variables, auto ಮತ್ತು string

8 min 20 XP

C++ ನಲ್ಲಿ bool (true/false) ಮತ್ತು string (ಪಠ್ಯ) ಇವೆ, ಆದ್ದರಿಂದ C ಯ char-array ತಲೆನೋವು ಇನ್ನಿಲ್ಲ. auto ಇದ್ದರೆ compiler ನಿಮಗಾಗಿ type ನಿರ್ಧರಿಸುತ್ತದೆ.

Example: edit me and press Run

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.

bool ಪೂರ್ವನಿಯೋಜಿತವಾಗಿ 1/0 ಆಗಿ print ಆಗುತ್ತದೆ; boolalpha true/false print ಮಾಡುತ್ತದೆ. ದಶಮಾಂಶ ಸ್ಥಾನಗಳಿಗೆ <iomanip> ನಿಂದ fixed << setprecision(2) ಬಳಸಿ.

Challenge

+20 XP

string course ನಲ್ಲಿ "C++" ಮತ್ತು int hours ನಲ್ಲಿ 40 ಇಟ್ಟು print ಮಾಡಿ: Course: C++ Hours: 40

Output Loading C++ (first time takes a few seconds)
Press Run to see the result here.