printMultTable(int, int);
In this code, what does "int printMultTable(int, int);" mean ?
#include <stdlib.h>
#include <iostream>
#include <iomanip>
using namespace std;
int printMultTable(int, int);
int main()
{
int randRow, randCol, row, col, value;
char option = 'Y';
do{
cout<<"Find the wrong number in the multiplication table below:";
cout<<"\n(the program will print the full table along with a wrong number inserted in it.)\n";
randRow = rand()%10+1;
randCol = rand()%10+1;
value = printMultTable(randRow,randCol);
cout<<"\nEnter the row and column of the incorrect value: ";
cin>>row>>col;
if(row == randRow && col == randCol){
cout<<"Right!\n";
} else {
cout<<"Wrong! The incorrect value is in cell "<<randRow<<" and "
<<randCol<<" and should be "<< value <<"\n";
}
cout<<"\nPlay again?[y/n]:\n ";
cin>>option;
//cout<<"\n";
}while (option!='n');
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps