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 |
Which is the memory area not included in C program? give the reason
What is this infamous null pointer, anyway?
Why ordinary variable store only one value
what is the difference between unix os and linux os
What is a substring in c?
Why is c platform dependent?
Which of the Following will define a type NODE that is a node in a Linked list? A)struct node {NODE*next;int x;};type def struct node NODE; B)typedef struct NODE {struct NODE *next;int x;}; C)typedef struct NODE {NODE *next;int x;}; D)typedef struct {NODE *next;int x;}NODE;
main() { int x, arr[8]={11,22,33,44,55,66,77,88}; x=(arr+2)[3]; printf(ā%dā,x); }
What is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
Is it better to use a macro or a function?
Why does this code crash?
Where are c variables stored in memory?