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
Write an algorithm for implementing insertion and deletion operations in a singly linked list using arrays ?
Why doesnt that code work?
Write the test cases for checking a variable having value in range -10.0 to +10.0?
What is identifiers in c with examples?
What is the purpose of 'register' keyword?
What is the condition that is applied with ?: Operator?
Explain 'bit masking'?
What are the types of functions in c?
What is size of union in c?
differentiate built-in functions and user – defined functions.
Define Spanning-Tree Protocol (STP)
What is the use of gets and puts?
What are pointers? What are different types of pointers?
a way in which a pointer stores the address of a pointer which stores the value of the target value a) reference b) allocation c) multiple indirection d) none
What are actual arguments?