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 register variable in c language?
Why should I prototype a function?
What are the differences between new and malloc in C?
What is the difference between null pointer and the void pointer?
#include<stdio.h> int main( ) { Int a=300, b, c; if(a>=400) b=300; c=200; printf(“%d%d ”, b, c); return0; }
How can I change their mode to binary?
what is a constant pointer in C
what is ANSI and ISO
How can I delete a file?
What is FIFO?
What is the function of volatile in c language?
What do you mean by scope of a variable in c?