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 / lavanya
void main()
{
int i,n,sum;
printf("enter n");
scanf("%d",&n);
for(i=1,i<=n,i++)
{
sum=1;
sum=sum+(1%(2i+1));
printf("sum=%d");
}
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Can you please explain the difference between malloc() and calloc() function?
What is the basic structure of c?
Why is structure padding done in c?
What is a floating point in c?
how to write optimum code to divide a 50 digit number with a 25 digit number??
Explain the priority queues?
Where can I get an ansi-compatible lint?
Tell me what is null pointer in c?
C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions
what is uses of .net
What is hungarian notation? Is it worthwhile?
Is c still used?
Can a pointer point to null?
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is a null pointer in c?