Page

C Program to print the square of float number

#include<stdio.h>
#incude<conio.h>
void main()
{
float sqr(float);
float num,square;
clrscr();
printf("Enter a number:");
scanf("%f",&num);
square=sqr(num);
printf("\nSquare of %.2f is %.2f\n",num,square);
getch();
}
float sqr(float n)
{
return(n*n);
}

No comments:

Post a Comment