<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
  <channel>
    <title>'while loop problem' Thread RSS Feed</title>
    <link>http://www.programmersheaven.com/</link>
    <description>Contains the latest posts from the thread 'while loop problem' posted on the 'Beginner C/C++' forum at Programmer's Heaven.</description>
    <language>en</language>
    <copyright>Copyright 2013 Programmers Heaven</copyright>
    <pubDate>Wed, 19 Jun 2013 08:05:10 -0700</pubDate>
    <lastBuildDate>Wed, 19 Jun 2013 08:05:10 -0700</lastBuildDate>
    <generator>Argotic Syndication Framework 2007.3.0.1, http://www.codeplex.com/Argotic</generator>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <ttl>360</ttl>
    <image>
      <url>http://www.programmersheaven.com/images/ph.gif</url>
      <title>Programmers Heaven</title>
      <link>http://www.programmersheaven.com/</link>
      <width>88</width>
      <height>31</height>
    </image>
    <item>
      <title>while loop problem</title>
      <link>http://www.programmersheaven.com/mb/beginnercpp/429852/429852/while-loop-problem/</link>
      <description>This problem is from a previous assignment that I only recieved partial credit on, and I want to know where I went wrong.&lt;br /&gt;
&lt;br /&gt;
The task is, by using a while loop, to take 4 integers and sum up only those that are greater or equal to ten.&lt;br /&gt;
&lt;br /&gt;
Here's what I had so far:&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
&lt;br /&gt;
int main()&lt;br /&gt;
{&lt;br /&gt;
	int counter;&lt;br /&gt;
	int grade;&lt;br /&gt;
	int total;&lt;br /&gt;
&lt;br /&gt;
	total = 0;&lt;br /&gt;
	counter = 1;&lt;br /&gt;
&lt;br /&gt;
	while( counter &amp;lt;= 4 ) {&lt;br /&gt;
		printf( "Enter an integer:\n" );&lt;br /&gt;
		scanf( "%d", &amp;amp;grade );&lt;br /&gt;
		counter++;&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
		if ( grade &amp;gt;= 10 ) {&lt;br /&gt;
		&lt;br /&gt;
			total = total + grade;&lt;br /&gt;
		}&lt;br /&gt;
		else {&lt;br /&gt;
			total = total;&lt;br /&gt;
		}&lt;br /&gt;
	&lt;br /&gt;
		&lt;br /&gt;
		&lt;br /&gt;
	printf( "The total is %d\n", total );&lt;br /&gt;
	}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
Any help would be greatly appreciated! Thank you!&lt;br /&gt;</description>
      <guid isPermaLink="true">http://www.programmersheaven.com/mb/beginnercpp/429852/429852/while-loop-problem/</guid>
      <pubDate>Tue, 16 Oct 2012 13:08:20 -0700</pubDate>
      <category>Beginner C/C++</category>
    </item>
  </channel>
</rss>