#include<stdio.h>
#include<conio.h>
int Total,i,N[6],rata2;
void main( )
{
Total=0;
i=1;
N[1]=25;
N[2]=15;
N[3]=10;
N[4]=20;
N[5]=5;
do
{
Total=Total+N[i];
i=i+1;
rata2=(N[1]+N[2]+N[3]+N[4]+N[5])/5;
}
while(i<=5);
printf("cetak:%d",Total);
printf("\nrata2:%d",rata2);
getch( );
}
#include<conio.h>
int Total,i,N[6],rata2;
void main( )
{
Total=0;
i=1;
N[1]=25;
N[2]=15;
N[3]=10;
N[4]=20;
N[5]=5;
do
{
Total=Total+N[i];
i=i+1;
rata2=(N[1]+N[2]+N[3]+N[4]+N[5])/5;
}
while(i<=5);
printf("cetak:%d",Total);
printf("\nrata2:%d",rata2);
getch( );
}
0 komentar:
Posting Komentar