Tuesday, July 31, 2018

C program for find square value

This is an example of how to find square value of a number using function. 



#include<stdio.h>
float square ( float x );

int main( )
{
    float m, n ;
    printf ( "\nEnter some number for finding square \n");
    scanf ( "%f", &m ) ;

    n = square ( m ) ;
    printf ( "\nSquare of the given number %f is %f",m,n );
}

float square ( float x )
{
    float p ;
    p = x * x ;
    return ( p ) ;
}

Output:

No comments:

Post a Comment

C program for find square value

This is an example of how to find square value of a number using function.  #include<stdio.h> float square ( float x ); int ma...