to print, sum of cubes of odd numbers between 1 and 10.
Vrite a program to print sum of cubes of odd.
7. Write a
e a program
to print the following series:
Answers
Answered by
0
Answer:
# include<stdio.h>
# include<math.h>
int main()
{
int n;
int i;
int sum;
printf("enter your range : ");
scanf("%d",&n);
printf("printing the odd number between 1 to %d: ",n);
for(i=1;i<=n;i++)
{
if(i%2!=0)
{
printf("%d\t",i);
sum=sum+pow(i,3);
}
}
printf("\nresult of sum of cube of 1 to %d: %d",n,sum);
}
Explanation:
Similar questions