
prob with my cimple prog
The use of this program is that there is an equation,the program asks for the inputs in this equations and the tries to get the value of (f) which is present in both sides of the equation that would make both sides equals.The prob is that after the inputs are given nothing happens.
Code:
#include<stdio.h>
#include<math.h>
int main(void){
char wish;
int ks,rn,d;
float f;
printf("Enter the value of Ks : ");
scanf("%d", &ks);
printf("\nEnter the value of D : ");
scanf("%d", &d);
printf("\nEnter the value of RN : ");
scanf("%d", &rn);
while((1/sqrt(f))!=2*log((ks/(3.71*d))+(2.51/(rn*sqrt(f))))){
f+=0.01;
}
printf("Frequency f=%f2.1",f);}

That means the program never enters the loop and that means that the loop condition evaluated to false. Evaluate the condition yourself by hand with the same input data to see where it goes wrong.

f is never given a starting value. Comparing for floating point (in)equality is not so simple: http://cfaq.com/fp/fpequal.html.
