Tag Archives: #doingallmasteries

Mastery12

 

Here is the youtube link to mastery12: https://www.youtube.com/watch?v=kNgEAiYSGkg

Functions in c++ are really important in order to do lots of repetitive stuff. Instead of writing down the code for a sum or something like that, you can just call a function that does that every time you want. Here is a simple example:

<iostream>

using namespace std;

 

int function1(int a, int b){

  int c;

  c=a*b;

  cout<<“c: “<<c<<endl;

  return 0;

}

int main(){

  int a,b;

  cout<<“give me a:”<<endl;

  cin>>a;

  cout<<“give me b:”<<endl;

  cin>>b;

  function1(a,b);

}

I created all my accounts including github, twitter and the “known” blog #Mastery03 #doingallmasteries

I created all my accounts including github, twitter and the “known” blog #Mastery03 #doingallmasteries