Write a program to add the following
¼+2/4+3/4+5/3+6/3+...
(Like up to any 12 no.s)
Answer Posted / nitin garg
#include <stdio.h>
#include <conio.h>
int main()
{
float i,j,m=3,n=4;
float sum=0,fact=1;
for(i=1;i<=15;i++)
{
for(j=i;j<=m;j++)
{
sum=sum+(j/n);
printf("%f/%f +",j,n);
}
i=i+3;
m=m+4;
n--;
}
printf("
Sum of the series %f",sum);
getch();
}
| Is This Answer Correct ? | 4 Yes | 0 No |
Post New Answer View All Answers
Is array name a pointer?
List some applications of c programming language?
What is line in c preprocessor?
Explain what header files do I need in order to define the standard library functions I use?
What is the newline escape sequence?
What is difference between far and near pointers?
main use of recursive function a) processing speed high b) reduce program length/reduce repeated statements c) if you do not, use iterative methods like, for, while or do-while d) all the above
What is #line?
Why is c so popular?
Why do some versions of toupper act strangely if given an upper-case letter?
What is the difference between Printf(..) and sprint(...) ?
How many levels of pointers have?
What is a void pointer? When is a void pointer used?
What is the difference between int main and void main?
What does a derived class inherit from a base class a) Only the Public members of the base class b) Only the Protected members of the base class c) Both the Public and the Protected members of the base class d) .c file