LauriFriberg

math.cpp, some math calculations

Sep 15th, 2018
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. //math.cpp
  2. //Creative Commons copyright (c) Lauri Friberg 2010, 2014, 2018
  3. //Converted from C to C++ on 15.9.2018 at 16:23 hours, (2018/9/15, September the 15th of 2018 at 4:23 PM).
  4.  
  5. //#include <stdio.h>
  6. #include <iostream>
  7. using namespace std;
  8.  
  9. int main() {
  10.  
  11. float a, b, c, x, y;
  12.  
  13. cout << "a="; cin >> a;
  14. cout << "b="; cin >> b;
  15. cout << "c="; cin >> c;
  16. cout << "x="; cin >> x;
  17.  
  18. y = a*x*x+b*x+c;
  19. cout << "y=ax²+bx+c=" << y << "\n";
  20.  
  21. return 0;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment