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
When should you not use a type cast?
In this problem you are to write a program that will cut some number of prime numbers from the list of prime numbers between 1 and N.Your program will read in a number N; determine the list of prime numbers between 1 and N; and print the C*2 prime numbers from the center of the list if there are an even number of prime numbers or (C*2)-1 prime numbers from the center of the list if there are an odd number of prime numbers in the list.
the statement while(i) puts the entire logic in loop. this loop is called a) indefinite loop b) definite loop c) loop syntax wrong d) none of the above
Is anything faster than c?
if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above
What are qualifiers in c?
What is array in C
What is the difference between array and linked list in c?
What is quick sort in c?
What is structure packing in c?
Where register variables are stored in c?
Do you know what are the properties of union in c?
What is string concatenation in c?
How do I round numbers?
Where define directive used?