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
What is pragma c?
Write a program to input the price of 1 burger and the number of burgers eaten by a group of friends .print the total amount to be paid by the group?
Explain union. What are its advantages?
Explain what is a const pointer?
What is extern keyword in c?
what are enumerations in C
Where define directive used?
What is pointer in c?
List out few of the applications that make use of Multilinked Structures?
Explain how can I convert a string to a number?
What is the right type to use for boolean values in c? Is there a standard type?
What language is c written?
Why structure is used in c?
What are register variables in c?
Explain the concept and use of type void.