eolymp
bolt
Try our new interface for solving problems
Problems

Function tabulation

published at 4/10/24, 2:38:51 pm

include <iostream>

include <cmath>

using namespace std; int main() { double a,b,h; cin>>a>>b>>h;

for (double x = a; x <= b; x += h) {
    double y = 3 * sin(x);
    printf("%.3lf %.3lf\n",x,y);
}

return 0;

}

published at 4/13/24, 4:46:34 pm

include <bits/stdc++.h>

using namespace std;

int main(){

int a,b;

double h;

cin>>a>>b>>h;

for(double i=a;i<=b;i+=h)

{

double y=3*sin(i);

cout<<fixed<<setprecision(3)<<i<<" "<<y<<endl;

}

}