Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is #line in c?

963


What is the difference between variable declaration and variable definition in c?

1017


Explain the red-black trees?

1055


Why we use break in c?

937


what is different between auto and local static? why should we use local static?

1079


What is table lookup in c?

1037


How do we make a global variable accessible across files? Explain the extern keyword?

1831


What is 2 d array in c?

963


What are the different types of data structures in c?

1114


How can I access an I o board directly?

1040


What is floating point constants?

1086


Is anything faster than c?

971


What is storage class?

1019


Explain what math functions are available for integers? For floating point?

1066


Why should I use standard library functions instead of writing my own?

1209