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
Can we use any name in place of argv and argc as command line arguments?
Why c is a procedural language?
how can i access hard disk address(physical address)? are we access hard disk by using far,near or huge pointer? if yes then please explain.....
What is pivot in c?
When c language was developed?
Draw a diagram showing how the operating system relates to users, application programs, and the computer hardware ?
Why is structure padding done in c?
What is the difference between array and linked list in c?
What is the size of empty structure in c?
What is mean by Data Driven framework in QTP? Can any one answer me in details on this regard.
any restrictions have on the number of 'return' statements that may be present in a function. a) no restriction b) only 2 return statements c) only 1 return statements d) none of the above
What is c value paradox explain?
Differentiate between static and dynamic modeling.
Write a Program to accept different goods with the number, price and date of purchase and display them
how can I convert a string to a number?