Program c++ nya :
#include <cstdlib>
#include <iostream>
#define sentinel -44
using namespace std;
int main(int argc, char *argv[])
{
int sum=0,score;
cout<<"Enter first score ( or "<<sentinel<<"to quit)>";
cin>>score;
while (score !=sentinel){
sum += score;
cout<<"enter next score("<<sentinel<<"to quit)>";
cin>>score;
}
cout<<"Sum of exam score is "<<sum<<endl;
system("PAUSE");
return EXIT_SUCCESS;
}
#Screenshotnya :
Tidak ada komentar:
Posting Komentar