Loading...

Calculate Square of numbers entered by user

Programme:

#include<stdio.h>
#include<conio.h>

void main()
{
    int n, sqr = 0;
 
    printf("\nEnter a number : ");
    scanf("%d",&n);
    sqr=n*n;
    printf("\nSquare of %d is %d.",n,sqr);
    getch();
}

Output:

Enter a number : 6

Square of 6 is 36.