mdnurnobihosen

Assignment11

Feb 24th, 2019
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.38 KB | None | 0 0
  1. #include <stdio.h>
  2. #include <math.h>
  3.  
  4. int main()
  5. {
  6.     int i,n,square,cube;
  7.     double sr;
  8.  
  9.     printf("Input: ");
  10.     scanf("%d",&n);
  11.  
  12.     printf("No     Square   Cube    Square root\n",n);
  13.     for(i=1;i<=n;i++)
  14.     {
  15.         square=(i*i);
  16.         cube=(i*i*i);
  17.         sr=sqrt(i);
  18.         printf("%d\t %ld\t %ld\t %.2f\n",i,square,cube,sr);
  19.     }
  20.  
  21.     return 0;
  22. }
Add Comment
Please, Sign In to add comment