Write a c program for sum of first n terms of the series
S = 1 - (1/3) + (1/5) -(1/7) + (1/9) ......
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / 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 |
explain what is a newline escape sequence?
inline function is there in c language?
write a own function for strstr
Can one function call another?
compare array with pointer?
What are the 5 data types?
Is it possible to have a function as a parameter in another function?
Why string is used in c?
How to write a code for implementing my own printf() and scanf().... Please hep me in this... I need a guidance... Can you give an coding for c... Please also explain about the header files used other than #include<stdio.h>...
Can we access RAM? How? Whats the range of access? Similarly What are other hardware we can access?
What is the significance of c program algorithms?
what will be the output for the following main() { printf("hi" "hello"); }