Student Portfolio >> Index >> Coding >> Exercise 14
#include <iostream.h> int main()
{
float total, val;
total=0;
cout<<"enter value:";
cin>>val;
while(val>=0)
{
total = total + val;
cout <<"enter next value:";
cin >>val;
}
cout <<"total = "<<total<<"\n";
return 0;
}
<< Back Forward >> |
Copyright 2005 Kerstin Kegel