Skip to main content
Write a user-defined function to perform Square of a number.
CODING:
# include <stdio.h>
# include <conio.h>
void main()
{
int x,s;
int sqr(int);
clrscr();
printf ("\n Enter a Number : ");
scanf ("%d",&x);
s=sqr(x);
printf("\n Square of %d is = %d",x,s);
}
sqr (int x)
{
return (x*x);
}
OUTPUT:
Comments
Post a Comment