//////////////////////////////////////////////////////////////////////////////////////////
//
// A c++ based program that multiplies 2 positive integers using repetitive //addition.
//
//////////////////////////////////////////////////////////////////////////////////////////
#include
void main(){
char ans='y';
do{
int x=0;
int y=0;
int prod=0;
input_firstNumber:
cout<<"Firts Num: ";
cin>>x;
if(x>0){
input_secondNumber:
cout<<"Second Num: ";
cin>>y;
if(y>0){
while(y!=0){
prod=prod+x;
y--;
}
}
else
goto input_secondNumber;
}
else
goto input_firstNumber;
cout<
cout<<"Coninue? Y/N";
cin>>ans;
}while(ans=='Y' || ans=='y');
}
Tuesday, November 25, 2008
Repetitive Addition - c++ based programming
Posted by
Carlo Carollo
at
3:00 PM
Labels: Programming
Subscribe to:
Post Comments (Atom)
Search
Categories
- Extra Income (1)
- Funny (2)
- Just a Thought (6)
- Outings (1)
- Programming (9)
- Santos (1)
- Thesis/Project Ideas (1)
- Troubleshooting (4)
- Ultimate Fighting Championship (3)
- Web Programming (7)
Featured Video
News Bloopers!!!

0 comments:
Post a Comment