Advertisement
Guest User

Untitled

a guest
Sep 21st, 2019
95
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.85 KB | None | 0 0
  1. /******************************************************************************
  2.  
  3. Welcome to GDB Online.
  4. GDB online is an online compiler and debugger tool for C, C++, Python, Java, PHP, Ruby, Perl,
  5. C#, VB, Swift, Pascal, Fortran, Haskell, Objective-C, Assembly, HTML, CSS, JS, SQLite, Prolog.
  6. Code, Compile, Run and Debug online from anywhere in world.
  7.  
  8. *******************************************************************************/
  9. #include <iostream>
  10. #include <math.h>
  11. using namespace std;
  12. float f(float a)
  13. {
  14. return sqrt(a) * sin (4 * a);
  15. }
  16. int main()
  17. {
  18. float dx, xmin, xmax;
  19. cout << "Enter start and end of span" << endl;
  20. cin >> xmin >> xmax;
  21. cout << "Enter sampling frequency" << endl;
  22. cin >> dx;
  23. for(float i = xmin; i <= xmax; i += dx)
  24. {
  25. cout << i << " " << f(i) << endl;
  26. }
  27. return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement