Lecture 155
//Procedures and Functions
//Code:
#include <iostream>
#include <conio.h>
using namespace std;
void Register();
void increment();
void increment1(); //
Prototype
main ()
{
Register();
increment();
increment();
increment1();
increment1();
getch();
return 0;
}
void Register()
{
register int i;
for(i=1;i<6;i++)
cout
<<"\n Register i : "<<i;
}
void increment()
{
auto int i=1;
cout
<<"\n increment in auto i : "<<i;
i=i+1;
}
void increment1()
{
static int i=1;
cout
<<"\n increment in static i : "<<i;
i=i+1;
}
Output: