* A function is a group of statements that can perform a particular tasks.
But how we was performing the tasks without knowing about function ? Actually we was using a function named "main" function . A c++ program must have at least one function.
We can reuse function and we can modify it somewhere in program.
#include<iostream>
using namespace std;
int akash()
{
cout<< "technical akash will solve your all problems";
}
int main()
{
akash();
}
But how we was performing the tasks without knowing about function ? Actually we was using a function named "main" function . A c++ program must have at least one function.
We can reuse function and we can modify it somewhere in program.
#include<iostream>
using namespace std;
int akash()
{
cout<< "technical akash will solve your all problems";
}
int main()
{
akash();
}
Here int is called function return type which must be defined , and akash is function name which is further recalled in int function.
=> we can also modify functon after defining it , see below a example :-
#include<iostream>
using namespace std;
int akash()
int main()
{
akash();
akash();
}
int akash()
{
cout<< "technical akash will solve your all problems"<<endl;
cout << "this is our modified function "<<endl;
}
No comments:
Post a Comment