Discover the best answers to your questions with the help of IDNLearn.com. Discover prompt and accurate answers from our experts, ensuring you get the information you need quickly.
Given the availability of a file named numbers write the statements necessary to read an integer from standard input and then read in that many values from numbers and display their total.
#include
using namespace std;
int main()
{
int a,num,sum=0;
cout << " enter no of numbers";
cin>> num;
cout << endl;
for(int i=0; i
{
cout <<" enter number";
cin>> a;
sum = sum+a;
cout << endl;
}
cout << " sum of numbers is " << sum << endl;
return 0;
}
Professor wants these things as well.Your program should start with comments containing your name, the name of your program, and what the program does. You must indent statements according to the standard used in your textbook. Do not use single letter variable names. There should be comments at variable declaration to explain the purpose of each variable. There should be comments at each major point of the program such as the input subsection, looping subsection, output subsection, calculation subsection, and so on.
Sagot :
We are delighted to have you as part of our community. Keep asking, answering, and sharing your insights. Together, we can create a valuable knowledge resource. Your search for answers ends at IDNLearn.com. Thank you for visiting, and we hope to assist you again soon.