#include <stdio.h>
double square(double num)
{
return (num * num);
}
int main()
{
int num;
double n;
printf("\n\n Function : find square of any number :\n");
printf("------------------------------------------------\n");
printf("Input any number for square : ");
scanf("%d", &num);
n = square(num);
printf("The square of %d is : %.2f\n", num, n);
return 0;
}C Programming
Program to find the square of any number using the function.

Written by
View ProfileNikhil Juneja
Passionate software developer and technical contributor at TutorialsLink.
