67 172
Assignments Done
99,3%
Successfully Done
In November 2018

Answer to Question #23138 in C++ for fadil

Question #23138
Write a C++ program that uses while loop to prompt the user to enter 10 integers and the program will calculate the total for all numbers that are smaller than 20. Display the total.
Question 5
Expert's answer
#include <iostream>

using namespace std;

int main()
{
cout << "enter 10 numbers" << endl;
int k[10];
for(int i=1;i<=10;i++)
{
& cin>>k[i];

}

cout<<endl;

& for(int i=1;i<=10;i++)
{

& if(k[i]<20){cout<<k[i]<<endl;}
}
return 0;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions