Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #define _CRT_SECURE_NO_WARNINGS
- #include <stdio.h>
- #include <math.h>
- #include <time.h>
- #include <conio.h>
- #include <stdlib.h>
- double f(double, int *);
- int main() {
- double x;
- int * kod = 0;
- do {
- scanf("%lf", &x);
- printf("%lf", f(x, &kod));
- printf("\n %d", kod);
- } while (kod != -1);
- _getch();
- _getch();
- }
- double f(double x, int *kod) {
- if (x > 0) {
- *kod = 1;
- return x = x * (sin(log(x)) + cos(log(x)));
- }
- else {
- *kod = -1;
- return 0;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement