Develop a C program to perform addition of all the successive integer numbers starting from 1 till the value of addition is becomes 100 or more using break statement

Code

#include<stdio.h>
int main(){
int sum=0, i=0;
while(1){
sum = sum+i;
i++;

if(sum >= 100){
break;
}

}

printf("Sum = %d\n", sum);
}

Output


Try