#include <stdio.h>
#include <math.h>

double function(double x){
    double y;
    
    y=log(cos (x));
    return y;
}
    

int main() {
    long i,max;
    double dx=0.000001, start=0, end=3.141592/4;
    double integral=0.;

    max=(end-start)/dx;

    for( i=0; i<max; i++){
        integral+=dx*function(start+i*dx);
    }
    
    printf("%.10lf",integral);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: