Generation

generate functionSun, 21 May 2023

Write a program in C++ to calculate the value of exp(r) in 0.1 increments from r = 0 to 2.0.

#include <iostream> #include <math.h> /* exp */ using namespace std; int main () { double r; double x; for (r=0;r<=2;r=r+0.1) { x=exp(r); cout <<"The exponential value of "<< r <<" is "<< x << endl; } return 0; }

Questions about programming?Chat with your personal AI assistant