#include <iostream>usingnamespace std;
// Functions do not need to return values.// The return type is then specified as "void".void blankLines(int count);
int main()
{
cout << "Intro to Programming in C++\n";
blankLines(2);
cout << " 5 November 2012\n";
blankLines(4);
cout << "by Chris League\n";
return0;
}
void blankLines(int count)
{
for(int i = 0 ; i < count ; i++ )
{
cout << "\n";
}
//cout << "blankLines: " << count << endl;
}
#include <iostream>usingnamespace std;
void print_chars(int count, char c);
int main()
{
print_chars(40, '='); // single quotes around a character type
cout << "\n";
for(int i = 1; i <= 20; i++) {
print_chars(i, '*');
cout << "\n";
}
return0;
}
#include <iostream>usingnamespace std;
// Function declarations should come firstfloat average(float x, float y);
// Once there's a declaration, function definitions// can come in any order.int main()
{
cout << average(3, 5) << endl;
return0;
}
float average(float x, float y)
{
return (x+y)/2;
}