Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <stdlib.h>
- #include <math.h>
- int main()
- {
- float x, result;
- printf("Podaj x \n");
- scanf("%f", &x);
- if(x<-1){
- result = pow(x,2);
- printf("%f", result);
- } else if(x>1){
- result = 1/x;
- printf("%.2f", result);
- } else {
- result = 2*x;
- printf("%.6f", result);
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement