2-4

j20252119 · updated April 20, 2026
/*E2-4*/
/*実数の2乗と3乗*/
#include <stdio.h>
int main() 
{
    double a,b,c;
    a=2.5;
    b=a*a;
    c=a*a*a;
    printf("2.5の2乗 = %.2f\n",b);
    printf("2.5の3乗 = %.3f\n",c);
    return 0;
}
Output

Comments

Please sign up or log in to contribute to the discussion.