#hi i want to know if this program is correct

7 messages · Page 1 of 1 (latest)

bleak sentinel
#

#include <stdio.h>
#include <stdlib.h>
#include <math.h>

float myfunc(float x)
{
return pow(x,4)-24log(x)+3pow(sin(x),2);
}
int main()
{
float x, result;
printf("Enter any number: ");
scanf("%d",&x);
result=myfunc(x);
printf("Result=%f",result);
return 0;
}

rugged sunBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

jade nymph
#

!code

rugged sunBOT
# jade nymph !code
How to Format Code on Discord
Markup

```cpp
int main() {}
```

Result
int main() {} ```
jade nymph
#

Also, "correct" is a matter of what do you want the code to do

rugged sunBOT
#
#include <math.h>
#include <stdio.h>
#include <stdlib.h>

float myfunc(float x) {
  return pow(x, 4) - 24 * log(x) + 3 * pow(sin(x), 2);
}
int main() {
  float x, result;
  printf("Enter any number: ");
  scanf("%d", &x);
  result = myfunc(x);
  printf("Result=%f", result);
  return 0;
}
saltysprinkles