Function in C++ Programming
In this lesson, we will understand what is Function in C++ Programming and how to create them along with some examples.
What is Function in C++
A function in C++ is a block of statements designed to perform a specific task. A function is also called reusable code because once it is created, it can be used repeatedly.
To clearly understand a function, let's consider a real-life example:
In the early days, we washed our clothes manually using our hands, repeating this task daily. Nowadays, we use a washing machine to do the same task. The washing machine is a perfect example of a function: it automates the task of washing clothes, allowing us to reuse it whenever required.
Unlock This Lesson & Start Learning!
Get full access to this lesson, practical exercises, quizzes, and your Mentora AI Tutor.
Special Offer, use coupon code DWL6BC to get additional discount of 10% on all subscription. Hurry limited time offer.
1 Month
Renews at ₹259/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
3 Months
Equivalent to ₹219.67/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
6 Months
Equivalent to ₹193.17/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor
12 Months
Equivalent to ₹179.92/month.
Manual renewal required.
No automatic charges.
- Premium lessons access
- Quizzes and exercises
- Mentora AI Tutor