a program to find the sum of all the odd numbers upto a given lnumber in c
int limit,i,sum=0;
setbuf(stdout,NULL);
printf("Enter a limit");
scanf("%d",&limit);
for(i=1;i<=limit;i++){
if(i%2!=0){
printf("%d
", i);
sum=sum+i;
}
}
printf("The sum of odd numbers from 0 to %d are :%d",limit,sum);