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 a function expand(s1,s2) that expands shorthand notations like a-z in the string s1 into the equivalent complete list abc...xyz in s2 . Allow for letters of either case and digits, and be prepared to handle cases like a-b-c and a-z0-9 and -a-z. z-a:zyx......ba -1-6-:-123456- 1-9-1:123456789987654321 a-R-L:a-R...L a-b-c:abbc
How can I find the modification date and time of a file?
Why we use void main in c?
What is the auto keyword good for?
Describe wild pointers in c?
How are strings stored in c?
Give a one-line C expression to test whether a number is a power of 2. [No loops allowed - it's a simple test.]
Why c is a procedural language?
Why is c faster?
What are inbuilt functions in c?
What are the header files used in c language?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
What are header files in c?
Give the rules for variable declaration?
what is the syallabus of computer science students in group- 1?