netx_iit

find out square and cube of given number and number given by

Jul 21st, 2020 (edited)
230
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.40 KB | None | 0 0
  1. //find out square and cube of given number and number given by user.
  2. /*
  3.     Input - 5
  4.     Output - Square of 5 is 25 and Cube of 5 is 125
  5. */
  6. #include<stdio.h>
  7. #include<conio.h>
  8. int main()
  9. {
  10.     int no1,s;//variable declartion part
  11.     printf("\nEnter any no =");
  12.     scanf("%d",&no1);
  13.     s=no1*no1;
  14.     printf("\n Square of %d is %d",no1,s);
  15.     s=no1*no1*no1;
  16.     printf("\n Cube of %d is %d",no1,s);
  17.     return 0;  
  18. }
Advertisement
Add Comment
Please, Sign In to add comment