write a program for egyptian fractions in c?
Answer Posted / himaja
egyptian fraction is of the series eg 1/2+1/3=5/6.
#include<stdio.h>
#include<conio.h>
main()
{
int n,i=2,sum=0;
float m=0;
scanf("%d",&n);
for(i=0;i<=n;i++)
{
m = float(1/i);
sum=sum+m;
}
printf("%d",sum);
getch();
}
| Is This Answer Correct ? | 7 Yes | 8 No |
Post New Answer View All Answers
What is function what are the types of function?
Explain the concept and use of type void.
What is default value of global variable in c?
What happens if a header file is included twice?
What is the advantage of c?
How are structure passing and returning implemented?
Is there a way to compare two structure variables?
What is the meaning of ?
What language is lisp written in?
What is header file in c?
Why is C language being considered a middle level language?
Why do we need volatile in c?
C program to find all possible outcomes of a dice?
What is auto keyword in c?
How do you convert strings to numbers in C?