Lesson 7 of 24

Functions, Default Arguments మరియు Overloading

9 min 25 XP

Parameters వేరుగా ఉన్నంత వరకు C++ లో అనేక functions ఒకే పేరును పంచుకోవచ్చు (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 ను spaces తో 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.