Demonstrate function definition preceding function calls - C++ Function

C++ examples for Function:Function Creation

Description

Demonstrate function definition preceding function calls

Demo Code

#include <iostream>
using namespace std;                 //no function declaration
void starline()/*  w w w .j av  a  2s  .c  o  m*/
{
   for(int j=0; j<45; j++)
      cout << '*';
   cout << endl;
}
int main()
{
   starline();
   cout << "Data type   Range" << endl;
   starline();
   cout << "char        -128 to 127" << endl
       << "short       -32,768 to 32,767" << endl
       << "int         System dependent" << endl
       << "long        -2,147,483,648 to 2,147,483,647" << endl;
   starline();
   return 0;
}

Result


Related Tutorials