#include <iostream.h>
#include <conio.h>
main (void)
{
int a,b,c,d;
a=1;
b=0;
cout<<"masukkan n = ";
cin>>c;
cout<<"bilangan yang di cari rata rata adalah ="<<endl;
while (a<=c)
{
b=b+a;
cout<<a<<" ";
a++;
}
d=b/c;
cout<<endl<<endl<<"rata rata= "<<d;
getch();
}
Rabu, 17 April 2013
Langganan:
Posting Komentar (Atom)
0 komentar:
Posting Komentar