C program to calculate the square of a number

# include< stdio.h >
# include< conio.h >
void main ()
{
          int x, y;
          clrscr();
          printf(" Enter a number : ");
          scanf("%d",&x);
          y=x*x ;
          printf(" The square of %d is %d",x,y);
          getch();
}

OUTPUT :

Enter a number : 5
The square of 5 is 25

No comments :

Post a Comment