Start: If Array (I) Small
Start: If Array (I) Small
Flowchart:
Start
Small=1000; counter=0;i=0
Read Array[i]
ii+1
Yes
If Array[i]<small
small = Array[i]
No
OccOcc+1
Yes
i<10
No
Print smallest
int, occ
END
Algorithm:
Start
Initialize the local integers
Small = 1000;
Initialize the Array
For i from 1 to 10 do
Read Array(i)
If(smallest<tab(i))
smallest<-tab(i)
occ = occ + 1 // Occurrence Counter
endif
end for
Print(smallest Integer, occ)
END
Program C++:
#include<iostream.h>
void main( void)
{
int myArray[10];
int small=10000;
int counter=0;
cout<<"Enter ten(10) numbers to be check for small value
and occurence count\n";
}
}
{
if (myArray[iLoop] == small)
counter+=1;
}
cout<<"\n"""<<small<<" ""is the smallest number repeated
("<<counter<<") times";
}
Print screen: