We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,437 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

I need help on a C++ looping program

OK Im new to C++, I'm still a beginner, i know how to make simple calculations and all. But looping is completely different and I have no idea where to start: Here's all that I have for this question (Write an application that keeps inputting an integer from the user until zero is entered. The program will calculate and display the average of the numbers, and display the largest and smallest of the numbers. Zero is not to be included in the average, largest or smallest printouts.) :

#include <iostream>

using namespace std;

   int main()
{   int num;

 
	cout << "please enter a set of numbers" << endl;
	cin >> num;
	if( num > 0 )



  return 0;

Can someone please give me the rest of the answer for this question and give me basic explanation of how you did. THanks

2
Contributors
1
Reply
12 Minutes
Discussion Span
1 Year Ago
Last Updated
2
Views
I am dumb
Newbie Poster
2 posts since Oct 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

I would investigate the do-while loop

http://msdn.microsoft.com/en-us/library/b0kk5few.aspx

gerard4143
Nearly a Posting Maven
2,295 posts since Jan 2008
Reputation Points: 512
Solved Threads: 397
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page rendered in 0.0762 seconds using 2.69MB