afrinahoque

Square of any number using function

Jul 8th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.22 KB | None | 0 0
  1. #include<stdio.h>
  2. int square_num(int n)
  3. {
  4.     int square;
  5.     square=n*n;
  6.     return square;
  7. }
  8. int main()
  9. {
  10.     int n,square;
  11.     scanf("%d",&n);
  12.     square=square_num(n);
  13.     printf("%d",square);
  14.     return 0;
  15. }
Add Comment
Please, Sign In to add comment