Jumat, 02 Maret 2012

Belajar sedikit Dasar-dasar Pemrograman DevC++ [ Array ]

05.02



#include <cstdlib>
#include <iostream>
using namespace std;

int main(int argc, char *argv[])
{
int nilai;
int jumlah=0;
int rerata;
cout<<”masukkan banyak nilai mahasiswa:”;
cin>>nilai;
int array[nilai];
for(int x=0;x<nilai;x++){
cout<<”nilai ujian ke-1["<<x<<"]:”;
cin>>array[x];
jumlah +=array[x];
rerata=jumlah/nilai;
}
if(rerata<50)
cout<<”TIDAK LULUS”<<endl;
else
cout<<”LULUS”<<endl;
cout<<”jumlah nilai ujian:”<<jumlah<<endl;
cout<<”Rata-rata nilai ujian :”<<rerata<<endl;
system(“PAUSE”);
return EXIT_SUCCESS;
}

silahkan dicoba.., semoga bermanfaat :))


Written by

We are Creative Blogger Theme Wavers which provides user friendly, effective and easy to use themes. Each support has free and providing HD support screen casting.

0 komentar:

Posting Komentar

 

© 2013 Raizexe Blog. All rights resevered. Designed by Templateism

Back To Top