The solution for this problem doesn't complete all of thetasks asked by the question. The problem states that itwants the program to convert each decimal to an integer and thenfind the sum of tthe new integers. This solution clearly doesnot do that. The solution for this problem doesn't complete all of thetasks asked by the question. The problem states that itwants the program to convert each decimal to an integer and thenfind the sum of tthe new integers. This solution clearly doesnot do that.
Explanation / Answer
please rate - thanks this better? #include using namespace std; int main() {float d1,d2,d3,d4,d5; int sum; int i1,i2,i3,i4,i5; coutd1>>d2>>d3>>d4>>d5; //convert to integers i1=static_cast(d1); i2=static_cast(d2); i3=static_cast(d3); i4=static_cast(d4); i5=static_cast(d5); //and then find sum sum=i1+i2+i3+i4+i5; cout