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 stdout be forced to print somewhere other than the screen?

612


How do you define CONSTANT in C?

644


What are the functions to open and close file in c language?

723


What is the difference between char array and char pointer?

522


Explain what is the benefit of using enum to declare a constant?

580






When was c language developed?

693


what is stack , heap ,code segment,and data segment

2208


Why do we need arrays in c?

573


what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;

1879


If null and 0 are equivalent as null pointer constants, which should I use?

573


Explain what are compound statements?

597


how can i write a program that prints out a box such that whenever i press any key8(coordinate number) on the keyboard, the box moves.

1207


how to construct a simulator keeping the logical boolean gates in c

1718


How can I write functions that take a variable number of arguments?

618


#include main() { int *p, *c, i; i = 5; p = (int*) (malloc(sizeof(i))); printf(" %d",*p); *p = 10; printf(" %d %d",i,*p); c = (int*) calloc(2); printf(" %d ",*c); }

620