Write a program to add the following
¼+2/4+3/4+5/3+6/3+...

(Like up to any 12 no.s)



Write a program to add the following ¼+2/4+3/4+5/3+6/3+... (Like up to any 12 no.s)..

Answer / 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

More C Interview Questions

what is a stack

3 Answers  


Is there any book to know about Basics of C Language?

4 Answers  


Can a pointer be static?

0 Answers  


What are file streams?

0 Answers  


Why do we use c for the speed of light?

0 Answers  






In c programming write a program that will print 10 multiples of 3 except 15,18,21 using looping

0 Answers  


plz answer....A program that takes 3 variables e.g a,b,c in as seperate parameters and rotates the values stored so that value goes a to b, b to c and c to a .

3 Answers  


Write a c pgm for leap year

11 Answers   College School Exams Tests, IBM, TCS,


How can type-insensitive macros be created?

0 Answers  


What is getch() function?

0 Answers  


c program to arrange digits in a no in ascending and descending order

1 Answers  


"%u" unsigned integer print the a) address of variable b) value of variable c) name of a variable d) none of the above

0 Answers  


Categories