#include<iostream>
using namespace std;
void multiplicationTable(int n){
cout<<"The multiplication table for "<<n<<" is:\n";
for(int i=0; i<=12; i++){
cout<<n <<" x "<< i<<" = "<<i * n<<endl;
}
}
void minMaxMean(int arr[10]){
double sum = 0.0;
int min = arr[0];
int max = arr[0];
for(int i=0; i<10; i++){
sum += arr[i];
}
for(int i=0; i<10; i++){
}
for(int i=1; i<10; i++){
if(arr[0] < arr[i]){
max = arr[i];
}
}
for(int i=0; i<10; i++){
if(arr[0] > arr[i]){
min = arr[i];
}
}
cout<<"The minimimum is: \t"<<min<<"\nThe maximum is: \t"<<max<<"\nThe mean is:\t"<<sum /10 <<endl;
}
int main(){
int arr[10] = {20,30,10,40,50,60,5, 70,80,120};
minMaxMean(arr);
int n;
cout<<"Enter a number to display its multiplication table\n";
cin>>n;
multiplicationTable(n);
}
Comments
Leave a comment