logo
Course thumb

The C programming language made simple

Square root and raising to a power in C

#include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char* argv[]) { float a = 81; float res = powf(a, 1.0f / 3.0f); printf("%f\n", res); res = sqrtf(a); printf("%f\n", res); return 0; }