a sum equal to or in excess of 100

This is a discussion on a sum equal to or in excess of 100 within the C Programming forums, part of the General Programming Boards category; Code:
#include <stdio.h>
int main (void)
{
int value, sum = 0;
printf ("Enter a value: ");
scanf ("%i", &value);
...

This program is to take user entered integers ranging from 0 to 25 until the sum of those entered integers is equal to or in excess of 100. I know the 0 to 25 constraint works fine, it's the sum part that isn't so fine.

Currently what the program does is it takes the first acceptable entered integer and just prints that as the sum as well. Ex: if I input 25 it will say the sum is 25.

It should keep asking for numbers until a sum of 100 or greater is reached.

There are 10 types of people in this world, those who cringed when reading the beginning of this sentence and those who salivated to how superior they are for understanding something as simple as binary.

Yeah, you have 2 separate loops. I would re-think how you are solving this problem. You could write this program, with one loop that executes until the sum equals or is greater than 100. Also, are you supposed to print the sum after each number is inputed or only, after the sum exceeds or is equal to 100? Also I would prompt the user for the first number and then also, prompt the user for the rest of the values because it would be confusing for anyone using your program. You could also just prompt the user once by saying: "Enter integers separated by pressing enter until the sum is >= to 100." Or better yet, write your own prompts so it isn't so hard to understand (I am a bad writer). Also, consider Just Prompting with "Enter a Number" for the first time and then "Enter Another Number" for each time leading up to the sum being >= to 100.