{"id":5154,"date":"2021-12-31T23:00:00","date_gmt":"2021-12-31T17:30:00","guid":{"rendered":"https:\/\/www.codingbroz.com\/?p=5154"},"modified":"2021-12-31T12:43:32","modified_gmt":"2021-12-31T07:13:32","slug":"c-program-to-find-sum-until-user-enters-positive-number","status":"publish","type":"post","link":"https:\/\/www.codingbroz.com\/c-program-to-find-sum-until-user-enters-positive-number\/","title":{"rendered":"C Program to Find Sum of 10 Numbers Until User Enters Positive Number"},"content":{"rendered":"\n

In this post, we will learn how to find the sum until the user enters a positive number using C<\/strong> Programming language.<\/p>\n\n\n\n

This program will take multiple inputs and find their sum, until the user enters a negative number. When the user enters a negative number, then this program will terminate the loop using break statement and resume the next statement after the loop.<\/p>\n\n\n\n

We will be using the following approaches to write this program.<\/p>\n\n\n\n

  1. Using For Loop<\/li>
  2. Using While Loop<\/li><\/ol>\n\n\n\n

    So, without further ado, let\u2019s begin this tutorial.<\/p>\n\n\n\n

    \n