Print My Dots !

A Simple Program written by me that asks the user for a number of dots to print out.

#include <iostream>

using std::cout;
using std::endl;
using std::cin;

char getDots(int number);

int main()
{
int number;
int submit;

cout << “Enter number of dots: “;
cin >> number;

submit = getDots(number);

return 0;
}

char getDots(int number)
{
if(number == 1)
{
cout << “.”;
return number;
}
else
{
int update = number;

while(update <= number)
{
cout << “.”;
update = update – 1;

if(update == 0)
{
update = update + ( number + 1 );
}
}
}
}

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: