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 function what are the types of function?

968


Explain the concept and use of type void.

1080


What is default value of global variable in c?

959


What happens if a header file is included twice?

1003


What is the advantage of c?

1075


How are structure passing and returning implemented?

1007


Is there a way to compare two structure variables?

1086


What is the meaning of ?

1013


What language is lisp written in?

1208


What is header file in c?

1040


Why is C language being considered a middle level language?

1085


Why do we need volatile in c?

1137


C program to find all possible outcomes of a dice?

2313


What is auto keyword in c?

1183


How do you convert strings to numbers in C?

1192