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


Please Help Members By Posting Answers For Below Questions

can any one provide me the notes of data structure for ignou cs-62 paper

1706


What is the purpose of the following code? Is there any problem with the code? void send(int count, short *to, short *from) { /* count > 0 assumed */ register n = (count + 7) / 8; switch (count % 8) { case 0: do { *to = *from++; case 7: *to = *from++; case 6: *to = *from++; case 5: *to = *from++; case 4: *to = *from++; case 3: *to = *from++; case 2: *to = *from++; case 1: *to = *from++; } while (--n > 0); } }

1959


any C program contains only one function, it must be a) void () b) main () c) message () d) abc ()

695


Write a code to generate a series where the next element is the sum of last k terms.

734


What is structure of c program?

607






What does %2f mean in c?

674


What is oops c?

611


my project name is adulteration of chille powder.how can i explain it to the hr when he asks me about the project?

1122


How will you print TATA alone from TATA POWER using string copy and concate commands in C?

920


Does c have class?

613


Given an array of 1s and 0s arrange the 1s together and 0s together in a single scan of the array. Optimize the boundary conditions?

981


What are pointers?

634


What are static variables in c?

629


What is the code for 3 questions and answer check in VisualBasic.Net?

1691


#define PRINT(int) printf("int = %d ",int) main() {< BR> intx,y,z; x=03;y=02;z=01; PRINT(x^x); z<<=3;PRINT(x); y>>=3;PRINT(y); }

720