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
Can stdout be forced to print somewhere other than the screen?
How do you define CONSTANT in C?
What are the functions to open and close file in c language?
What is the difference between char array and char pointer?
Explain what is the benefit of using enum to declare a constant?
When was c language developed?
what is stack , heap ,code segment,and data segment
Why do we need arrays in c?
what is associativity explain what is the precidence for * and & , * and ++ how the folloing declaration work 1) *&p; 2) *p++;
If null and 0 are equivalent as null pointer constants, which should I use?
Explain what are compound statements?
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.
how to construct a simulator keeping the logical boolean gates in c
How can I write functions that take a variable number of arguments?
#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); }