Created
October 23, 2011 09:37
-
-
Save karol-may/1307177 to your computer and use it in GitHub Desktop.
zadanie 23/10/11 7
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <math.h> | |
int main() | |
{ | |
double x,r,i; | |
scanf("%lf", &x); | |
if (x>0){ | |
r = sqrt(x); | |
i = 1/x; | |
printf(" \t Number: %lf\n\t Root: %lf\n\t Multiplicative inverse: %lf\n",x,r,i); | |
} | |
else if ( x==0 ){ | |
r = 0; | |
printf(" \t Number: %lf\n\t Root: %lf\n\t Multiplicative inverse: N\\A\n",x,r); | |
} | |
else if ( x<0 ){ | |
i = 1/x; | |
printf(" \t Number: %lf\n\t Root: N\\A\n\t Multiplicative inverse: %lf\n",x,i); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment