Advertisement
mustahidhasan

square, cube and square root till n

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