Thursday, May 21, 2020

Parameters and Arguments using function in C++

  • Syntax :

     void functionName(parameter1parameter2parameter3
        {
      // code to be executed        }

  • Program :

#include <iostream>
using namespace std;
void myFunction(string name) {
  cout << name << " Venkat\n";
}

int main(){
  cout <<"\n----------------FUNCTION PARAMETERS----------------\n";
  cout <<"\n----------------Parameters and Arguments----------------\n";
  myFunction("Monisha");
  myFunction("Janani");
  myFunction("Ramya");
  return 0;
}




  • Output :


No comments:

Post a Comment

Function Overloading in C++

https://monitechvenkat1620.blogspot.com Program : #include <iostream> using namespace std; int c(int x, int y) {   return...