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


Please Help Members By Posting Answers For Below Questions

Can you please explain the difference between malloc() and calloc() function?

1131


What is the basic structure of c?

1095


Why is structure padding done in c?

1141


What is a floating point in c?

1081


how to write optimum code to divide a 50 digit number with a 25 digit number??

3272


Explain the priority queues?

1084


Where can I get an ansi-compatible lint?

1156


Tell me what is null pointer in c?

1091


C program execution always begins with a) #include b) comment (/*-------*/) c) main() d) declaration instructions

1066


what is uses of .net

1742


What is hungarian notation? Is it worthwhile?

1232


Is c still used?

1056


Can a pointer point to null?

1073


main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }

1564


What is a null pointer in c?

1242