User Profile

Collapse

Profile Sidebar

Collapse
hellfire
hellfire
Last Activity: Apr 30 '12, 11:42 AM
Joined: Mar 27 '12
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • hellfire
    replied to Convert a while loop to a for loop
    in C
    @rekedtechie :

    Hey, I would totally agree with you, but dear it is required to stop if either condition fails so it has to be and operator.. I hope I have made myself clear to you.. :)
    See more | Go to post

    Leave a comment:


  • hellfire
    replied to Convert a while loop to a for loop
    in C
    Hey, whatever sir said is absolutely fine, but if you didnt get it from that, here is a code block :

    totalCalories += caloriesForItem ;
    for (count = 1; caloriesForItem != 0 && count != numberOfItems; count++)
    {
    cout<<"Enter the calories: ";
    cin >> caloriesForItem ;
    cout << "Total calories eaten today = " << totalCalories << endl;
    }...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...