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 |
Give a fast way to multiply a number by 7
15 Answers Accenture, Aricent, Microsoft,
post new interiew question and aptitude test papers
write a progam to compare the string using switch case?
N O S I E R + A S T R A L ---------------- 7 2 5 6 1 3
What is the use of a conditional inclusion statement in C?
Display names and numbers of employees who have 5 years or more experience and salary less than Rs.15000 using array of structures (name, number, experience and salary)
What is Conio.h ?
Can you subtract pointers from each other? Why would you?
Write a C program to fill a rectangle using window scrolling
main() { inta=10,b=20; a>=5?b=100:b=200; printf("%d ",b); }
What is a example of a variable?
What are the output(s) for the following ? #include char *f() {char *s=malloc(8); strcpy(s,"goodbye")} main() { char *f(); printf("%c",*f()='A'); }