C Program to Calculate the Sum of Natural Numbers up to 100 for neb class 12 Computer science.
#include<stdio.h>
#include<conio.h>
void main()
{
int i, sum = 0;
for(i=1; i<=100; i++)
{
sum=sum+i;
}
printf("The sum of numbers from 1 to 100: %d", sum);
getch();
}
Explore More C Programming tutorial →