I need my program to run and tell me the sum of the natural number entered also it needs to say along with the sum total i need it to show the sum of odd and even integers. This is what I have so far and it won't run correctly in C.
#include <stdio.h>
int main (void)
{
int n, i, sum = 0;
int sum1 = 0;
int sum2 = 0;
printf("enter a number and I will tell you the numbers sums.");
scanf("%d", &n);
for(i=1; i<= n; ++n)
{
sum2 = sum2 + n;
}
for(i=2; i<= n; ++n)
{
sum1 = sum1 + n;
}
for(i=1; i<= n; ++n)
{
sum += i;
}
printf("sum of integers is %d" ,sum);
printf("sum of odd integers is %d" ,sum1);
printf("sum of even integers is %d" ,sum2);
return 0;
}