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
Explain what are binary trees?
What should malloc(0) do?
Can include files be nested?
What is the translation phases used in c language?
Explain how can I convert a number to a string?
Which is more efficient, a switch statement or an if else chain?
What is wrong with this initialization?
What is the code in while loop that returns the output of given code?
Read the following data in two different files File A: aaaaaaaadddddddd bbbbbbbbeeeeeeee ccccccccffffffff File B: 11111111 22222222 33333333 By using the above files print the following output or write it in the Other file as follows aaaaaaaa11111111dddddddd bbbbbbbb22222222eeeeeeee cccccccc33333333ffffffffffff
Are local variables initialized to zero by default in c?
What is a substring in c?
Explain how can a program be made to print the name of a source file where an error occurs?
Why we write conio h in c?
I need testPalindrome and removeSpace
#include
what is a function method?give example?