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
How do I get a null pointer in my programs?
What is the benefit of using an enum rather than a #define constant?
What is f'n in math?
Explain why can’t constant values be used to define an array’s initial size?
Do you have any idea how to compare array with pointer in c?
Can we change the value of #define in c?
How do I read the arrow keys? What about function keys?
write a program to print the consecutive repeated character from the given string... input string is : hhhhjkutskkkkkggggj output should be like this: hhhhkkkkkgggg anyone help me...
What is a ternary operator in c?
write a program to display all prime numbers
How do you print an address?
What is wrong with this statement? Myname = 'robin';
Explain why c is faster than c++?
How will you find a duplicate number in a array without negating the nos ?
Why static is used in c?