/* interval.cpp * * INPUT: a, b, step h * OUTPUT: all numbers in [a,b] with a stepsize h * * Example: interval(0, 10, 0.1) should return * 0.0, 0.1, 0.2, ... , 10 */ #include using namespace std; void interval(float a, float b, float h){ int nmax = (b - a)/h; for (int i=0; i < nmax; i++){ cout << a + i*h << ", "; } cout << b << endl; } int main(){ float a, b, h; cout << "Dwse ta a, b, h" << "\n"; cin >> a >> b >> h; interval(a, b, h); return 0; }