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.