Advertisement
sazid_iiuc

Untitled

Jan 10th, 2021
121
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.29 KB | None | 0 0
  1. #include<stdio.h>
  2. #include<math.h>
  3.  
  4. int main()
  5. {
  6.     double n;
  7.  
  8.     scanf("%lf", &n);
  9.  
  10.     if (n >= 0)
  11.     {
  12.         printf("%lf\n", n * n);
  13.         printf("%lf", sqrt(n));
  14.     }
  15.     else
  16.     {
  17.         printf("Input number again:\n");
  18.         scanf("%lf",&n);
  19.     }
  20.    
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement