Solved programming problem

How to Find the Square of a Number in C.

Source code

#include<stdio.h>

int main()

{

    int n,sqr;

    printf("Please enter A Number : ");

    scanf("%d",&n);

    ///calculate the square

    sqr=n*n;

    printf("
 Square of %d is : %d
",n,sqr);

    return 0;

}

Output

Please enter A Number : 5

Square of 5 is :25

Join the discussion

Add your comment