Please note, this is a STATIC archive of website www.tutorialspoint.com from 11 May 2019, cach3.com does not collect or store any user information, there is no "phishing" involved.
Tutorialspoint

How to get square of a number using C?

#include <stdio.h>
float square (float);
int main()
{
  float a, b;
  printf("enter any number");
  scanf("%f",&a);
  b=square(a);
  printf("square of %f is %f\n", a, b);
  return 0;
}
float square (float x)
{
    float y;
    y=x*x;
    return (y);
}

Advertisements
Loading...

We use cookies to provide and improve our services. By using our site, you consent to our Cookies Policy.