Friday, 28 March 2014

o Program to create function that accepts an integer and displays its double

#include <iostream>
#include <conio.h>

using namespace std;

int square( int y );

int main()
{
      int x;

      for( x = 1; x <= 10; x++ )
             cout << square( x ) << endl;

      system("PAUSE");
      return 0;
}

int square( int y )
{
      return y * y;
}

No comments:

Post a Comment