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 can you find out how much memory is available?

1012


What are terms in math?

978


What are the different types of objects used in c?

968


Explain what will be the outcome of the following conditional statement if the value of variable s is 10?

1185


What is the difference between strcpy() and memcpy() function in c programming?

1024


In a switch statement, explain what will happen if a break statement is omitted?

995


Do character constants represent numerical values?

1284


Write a program to reverse a string.

1018


What is the explanation for the dangling pointer in c?

1059


The purpose of this exercise is to benchmark file writing and reading speed. This exercise is divided into two parts. a). Write a file character by character such that the total file size becomes approximately >10K. After writing close the file handler, open a new stream and read the file character by character. Record both times. Execute this exercise at least 4 times b). Create a buffer capable of storing 100 characters. Now after generating the characters, first store them in the buffer. Once the buffer is filled up, store all the elements in the file. Repeat the process until the total file size becomes approximately >10K.While reading read a while line, store it in buffer and once buffer gets filled up, display the whole buffer. Repeat the exercise at least 4 times with different size of buffer (50, 100, 150 …). Records the times. c). Do an analysis of the differences in times and submit it in class.

2021


What is %g in c?

1016


What are c preprocessors?

1121


What is c definition?

1191


The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this

3501


What is main () in c?

1007