Finds cube of entered number, create separate function for display - C Data Type

C examples for Data Type:int

Description

Finds cube of entered number, create separate function for display

Demo Code

#include <stdio.h>  

void showCube(double x);  

int main(void){  
     double val;  
       /*from   ww  w  .j av a  2s .c o m*/
     printf("Enter a floating-point value: ");  
     scanf("%lf", &val);  
     showCube(val);  
       
    return 0;  
}

void showCube(double x) {  
    printf("The cube of %e is %e.\n", x, x*x*x );  
}

Result


Related Tutorials