Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

How do I get a null pointer in my programs?

1165


What is the benefit of using an enum rather than a #define constant?

1321


What is f'n in math?

1142


Explain why can’t constant values be used to define an array’s initial size?

1401


Do you have any idea how to compare array with pointer in c?

1094


Can we change the value of #define in c?

1056


How do I read the arrow keys? What about function keys?

1150


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...

1998


What is a ternary operator in c?

1177


write a program to display all prime numbers

2021


How do you print an address?

1325


What is wrong with this statement? Myname = 'robin';

1393


Explain why c is faster than c++?

1126


How will you find a duplicate number in a array without negating the nos ?

2185


Why static is used in c?

1145