- #1
Windowmaker
- 68
- 0
I have to write a program in c++ that can be repeated as many times as needed. It should ask for a number to multply like
Enter a number to multply: 5
output is this
1 x 5=5
2 x 5=10
3 x 5=15
4 x 5 =20
5 x 5 =25
Enter a number to multiply : 8
1 x 5=5
2 x 5=10
3 x 5=15
4 x 5 =20
5 x 5 =25
6 x 5=30
7 x 5=35
8 x 5=40
Run again : N
My feebile attempt:
// mommy.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main
// Author: Jevin Barnett
// Date Written: 05 Oct 2011
// Program Description: Multiplcation Table
// variable declarations
int i, num, total;
char choice = 'Y';
do
{
cout << "Pick a Number to multiply \n. ";
cin >> num;
while ( i < n + 1);
{ total = i * n;
cout << total;
}
cout << "Run again? /n.";
cin >> choice:
while (choice == 'Y' || choice == 'y')
{
return 0;
}
Enter a number to multply: 5
output is this
1 x 5=5
2 x 5=10
3 x 5=15
4 x 5 =20
5 x 5 =25
Enter a number to multiply : 8
1 x 5=5
2 x 5=10
3 x 5=15
4 x 5 =20
5 x 5 =25
6 x 5=30
7 x 5=35
8 x 5=40
Run again : N
My feebile attempt:
// mommy.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int main
// Author: Jevin Barnett
// Date Written: 05 Oct 2011
// Program Description: Multiplcation Table
// variable declarations
int i, num, total;
char choice = 'Y';
do
{
cout << "Pick a Number to multiply \n. ";
cin >> num;
while ( i < n + 1);
{ total = i * n;
cout << total;
}
cout << "Run again? /n.";
cin >> choice:
while (choice == 'Y' || choice == 'y')
{
return 0;
}