Posts

Showing posts from April, 2023

96: ***(Syntax)*** Functions and Global Variables

functions 1: Use  using namespace std ;  above all the functions:  #include < iostream > using namespace std ; void happybday () {     cout << " Happy birthday to you \n" ;     cout << " Happy birthday to you \n" ;     cout << " Happy birthday dear you \n" ;     cout << " Happy birthday to you \n" ; } int main () {     happybday ();     cout << endl ;     happybday ();     return 0 ; } 2:  Enter just variable name that you want to pass to function in  main (){}  like  happybday ( name );  but also pass datatype in function declaration e.g.  void happybday ( string name )  : #include < iostream > using namespace std ; void happybday ( string name ) {     cout << " Happy birthday to " << name << endl ;     cout << " Happy birthday to " << name...