Program to find the sum of numbers from 1 to 100

this program for sum of numbers from 1 to 100. same way you can also give the starting number and ending number to addition


#include<stdio.h>
int main(){
int n,sum=0;
n=1;
while(n<=100){
sum=sum+n;
n++;
}
printf("Sum of 1 to 100 is : %d",sum);
return 0;
}
view raw 4c-ip.c hosted with ❤ by GitHub

Post a Comment

0 Comments

Ad Code

Join our New Telegram Channel