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

Tell me can the size of an array be declared at runtime?

1052


Define Spanning-Tree Protocol (STP)

1136


write a c program thal will find all sequences of length N that produce the sum is Zero, print all possible solutions?

2871


Which is better between malloc and calloc?

1205


What is the difference between the = symbol and == symbol?

1127


What does c mean?

1057


When should structures be passed by values or by references?

1046


What is the correct code to have following output in c using nested for loop?

1089


Is c is a high level language?

1195


What is actual argument?

1067


What is call by reference in functions?

1458


Explain what is the difference between the expression '++a' and 'a++'?

1215


Can you subtract pointers from each other? Why would you?

963


What is advantage of pointer in c?

1193


how to capitalise first letter of each word in a given string?

1930