Blog Introductions

In this  blog contains tutorials about  HTML Tutorials, Python Tutorials, CSS Tutorials, How to, PHP Tutorials, Java Tutorials, C++ Tutorials, Tutorials,  Examples, Source code,Learning,
Tips and Software development  services.C++ Function and their work |  C++ Toturials Bestitworrior 


 C++ Function and their work 

C++ Toturials





C++ Function and their work |  C++ Toturials Bestitworrior - Function is a block of code run when it is called.Function can't run without calling it.You can also pass one parameter or more.Function also return value .Functon code wirtten once and can be reuse it for many purposes.Function perform certein data operation inside the function.Function syntex is very simple void function_name(){//code}


Some Key Points of C++ Function




  1. Function is a combined block of code run when it execute
  2. Function can't run without calling it
  3. Function can return result
  4. Function perform various operation
  5. Function code is reuseable and for multipurpose
  6. You can send one or more then one parameter to function

Code


# include <iostream>
using namespace std;

void Function1()
{
cout << "I just got executed!\n";
}

void Function2(string fname) {
cout << fname << " Refsnes\n";
}

void Function3(string fname, int age) {
cout << fname << " Refsnes. " << age << " years old. \n";
}

int Function4(int x) {
return 5 + x;
}

int main()
{

Function1();
Function2("Best It Worrior is best platform");
Function3("Worrior", 36);
cout << Function4(10);
return 0;
}



OutPut


I just got executed!
Best It Worrior is best platform Refsnes
Worrior Refsnes. 36 years old.
15


I hope You really enjoyed this blog . I try my best to make every thing is easy and helpfull to provide to public .You will get more blog about the Programing project and code . Thanks for visiting my blog if you have any querry related to this you can comment here i will try my best to response you back about C++ Function and their work |  C++ Toturials Bestitworrior