Posted by : Unknown Thursday, December 14, 2017

hallo sobat TI! kali ini saya akan membahas bagaimana cara membuat program min dan maks menggunakan dev c++

langsung saja sedot source code

#include <iostream>
#include <conio.h>
#include <stdlib.h>

//MENCARI RATA - RATA, MAKSIMUM DAN MINIMUM

void main()
{
randomize();
int data, mak, min,tot=0;
float rata;
for(int i=1;i<=5;i++)
{
data=rand(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;
}
rata=tot/5;
cout<<"Rata-rata : "<<rata<<endl;
cout<<"Masimum : "<<mak<<endl;
cout<<"Minimum : "<<min<<endl;
getch();
}


Leave a Reply

sudah baca jangan lupa comment and like

Subscribe to Posts | Subscribe to Comments

program factorial bilangan dengan dev c++

#include <iostream> using namespace std; int main() { int b,c; cout<<“program oleh suparto”<<endl; cout<<“masukk...

- Copyright © mari kita berkembang😊 - Blogger Templates - Powered by Blogger - Designed by Johanes Djogan -