write a program for egyptian fractions in c?
Answer / 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 |
What is static identifier?
Write a program to check prime number in c programming?
why we use "include" word before calling the header file. is there any special name for that include??????
main() { static char *s[]={"black","white","yellow","voilet"}; char **ptr[]={s+3,s+2,s+1,s}, ***p; p=ptr; **++p; printf("%s",*--*++p+3); }
array contains zeros and ones as elements.we need to bring zeros one side and one other side in single parse. ex:a[]={0,0,1,0,1,1,0,0} o/p={0,0,0,0,0,1,1,1}
How do I copy files?
What is static memory allocation?
what defference between c and c++ ?
What are the uses of a pointer?
How to avoid buffer overflow?
What is meant by type specifiers?
find the output of the following program main() { int x=5, *p; p=&x; printf("%d",++*p); }