Contoh Perulangan Do... While

#include <iostream.h>
#include <conio.h>
#include <stdlib.h>
void main()
{
randomize();
int data, mak, min,tot=0,i=1;
float rata;
while(i<=5)
{
data=random(100);
cout<<"Data masuk : "<<data<<endl;
if (i==1)
mak=min=data;
else
{
if (mak<data)
mak=data;
if (min>data)
min=data;
}
tot=tot+data;
i++;
}
rata=tot/5;
cout<<"Rata-rata : "<<rata<<endl;
cout<<"Masimum : "<<mak<<endl;
cout<<"Minimum : "<<min<<endl;
getch();
}