Q:

C Program to find the square of any number using the function

0

C Program to find the square of any number using the function

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

#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;
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now