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 default रूप से 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.