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
How can you find out how much memory is available?
What are terms in math?
What are the different types of objects used in c?
Explain what will be the outcome of the following conditional statement if the value of variable s is 10?
What is the difference between strcpy() and memcpy() function in c programming?
In a switch statement, explain what will happen if a break statement is omitted?
Do character constants represent numerical values?
Write a program to reverse a string.
What is the explanation for the dangling pointer in c?
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.
What is %g in c?
What are c preprocessors?
What is c definition?
The postoder traversal is 7,14,3,55,22,5,17 Then ur Inorder traversal is??? please help me on this
What is main () in c?