What is a function? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What is a function?

function is very complicated can anyone tell me an easy way for learning functions?

14th Nov 2016, 6:12 AM
Fazle Yazdan
Fazle Yazdan - avatar
9 Answers
+ 31
A function is a group of statements that together perform a task. Every C++ program has at least one function, which is main(), and all the most trivial programs can define additional functions. A function declaration tells the compiler about a function's name, return type, and parameters. A function definition provides the actual body of the function. A C++ function definition consists of a function header and a function body.
14th Nov 2016, 6:19 AM
Lara
Lara - avatar
+ 5
A function is a set of orders that are ready to do something! when you need to do the same task in many programs, you can write a function and save it then you can access it and give him related arguments and get the results thus you have saved your self some time and didn't write the same set of orders over and over again for example plus action is predefined in a function by the platform that sums arguments you can create a function that can uses plus sign to multiply argumants
17th Nov 2016, 7:39 PM
Faramarz Monazami
Faramarz Monazami - avatar
+ 1
Function is nothing but the action taken on different attributes. Set of statements are used in function to perform particular task. eg. If I want to add two integers then I'll just call the add() function and pass it 2 integers it'll return me the addition..
3rd Dec 2016, 9:22 AM
ankush
ankush - avatar
0
functions are mathematical objects that return a value upon input. You can think in something similar in the case of programming. You define your function passing arguments and returning values or nothing (void).
14th Nov 2016, 9:48 AM
Leonardo Espinosa
Leonardo Espinosa - avatar
0
A function is a set of statements used to resolve a problem located out the main program, it's used to avoid repetition of code it's written once and called many times, and for program modulation that means divide the program into subprograms a program that use functions is more visible, understandable, robust and efficient than a program that write everything in a single program
19th Nov 2016, 9:00 PM
Abdelaziz Mustapha
Abdelaziz Mustapha - avatar
0
nnj if fjfturdhitgdzxx hi ibfyer hi in gh ikbdk hi of gh kb
26th Jan 2017, 6:33 PM
Vikas Tiwari
Vikas Tiwari - avatar
- 1
For solving any programming problem,we devided large programme into number of entities ,these entities known as functions. I hope ! I define the function in very easy way.
14th Nov 2016, 6:56 AM
Ajeet Singh
Ajeet Singh - avatar
- 1
a function is group of code which can act as we want
16th Nov 2016, 5:24 PM
Theba Ramiz
Theba Ramiz - avatar
- 2
Hi,Lara we're are you from ?
18th Nov 2016, 12:52 PM
Ali Khamees
Ali Khamees - avatar