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
What is struct node in c?
What is the importance of c in your views?
printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions
What is the difference between char array and char pointer?
C language questions for civil engineering
write a c program to print the next of a particular no without using the arithmetic operator or looping statements?
How can I find out how much free space is available on disk?
What is data structure in c and its types?
What are static variables in c?
What is an array? What the different types of arrays in c?
write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?
how can I convert a string to a number?
This is a variation of the call_me function in the previous question:call_me (myvar)int *myvar;{ *myvar += 5; }The correct way to call this function from main() will be a) call_me(myvar) b) call_me(*myvar) c) call_me(&myvar) d) expanded memory
What are the applications of c language?
What are integer variable, floating-point variable and character variable?