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.