Write a c program for sum of first n terms of the series
S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......
Answer Posted / amitabha mukhopadhyay
void main()
{
int i,n,sum;
printf("enter n");
scanf("%d",&n);
for(i=1,i<=n,i++)
{
sum=1;
sum=sum+(-1,i)*1/(2i+1));
printf("sum=%d");
}
Is This Answer Correct ? | 2 Yes | 0 No |
Post New Answer View All Answers
What are different storage class specifiers in c?
Write a C Program That Will Count The Number Of Even And Odd Integers In A Set using while loop
What is a dynamic array in c?
Is return a keyword in c?
write a C program: To recognize date of any format even formats like "feb-02-2003","02-february-2003",mm/dd/yy, dd/mm/yy and display it as mm/dd/yy.
Why do we need arrays in c?
What is dynamic variable in c?
What is the use of a semicolon (;) at the end of every program statement?
What type is sizeof?
What is page thrashing?
What are c preprocessors?
What is a constant?
Can the sizeof operator be used to tell the size of an array passed to a function?
What is string function in c?
What is the explanation for the dangling pointer in c?