Lesson 7 of 24

Functions, Default Arguments এবং Overloading

9 min 25 XP

Parameters আলাদা হলে C++-এ একাধিক function একই নাম নিতে পারে (overloading)। Default arguments শেষের parameters ঐচ্ছিক করে দেয়।

Example: edit me and press Run

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

Challenge

+25 XP

bool isPrime(int n) লিখুন। main()-এ n পড়ে 2 থেকে n পর্যন্ত প্রতিটি prime space দিয়ে আলাদা করে print করুন। Input: 20 → Output: 2 3 5 7 11 13 17 19

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