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);
#include <stdio.h>void main(){int i, number, odd_sum = 0, even_sum = 0;printf("Enter the value of number
");scanf("%d", &number);for (i = 1; i <= number; i++){if (i % 2 == 0)even_sum = even_sum + i;elseodd_sum = odd_sum + i;}printf("Sum of all odd numbers = %d
", odd_sum);printf("Sum of all even numbers = %d
", even_sum);}