Thursday, September 13, 2018

SQUARE OF A NUMBER

  • Problem Description

    Kavya is an engineering student very much interested in mathematics. She wants to design a C program to find the square of a number that is an integer. Help her to generate the code.
  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int n,s;
      scanf("%d",&n);
      s=n*n;
      printf("%d",s);
    return 0;
    }
  • Test Case 1

    Input (stdin)
    5
    
    
    Expected Output
    25
  • Test Case 2

    Input (stdin)
    6
    
    
    Expected Output
    36

No comments:

Post a Comment