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 |
Finding first/last occurrence of a character in a string without using strchr( ) /strrchr( ) function.
#include main() { char s[] = "Bouquets and Brickbats"; printf(" %c, ",*(&s[2])); printf("%s, ",s+5); printf(" %s",s); printf(" %c",*(s+2)); }
What is period operator in c?
Explain how do you determine whether to use a stream function or a low-level function?
write a method for an array in which it can display the largest n next largest value.
Why ca not I do something like this?
A collection of data with a given structure for excepting storing and providing on demand data for multiple users a) linked list b) datastructer c) database d) preprocessor
There is a practice in coding to keep some code blocks in comment symbols than delete it when debugging. How this affect when debugging?
how to sort two array of characters and make a new array of characters.
What does stand for?
How many identifiers are there in c?
Explain union. What are its advantages?