fork download
  1. #include <iostream>
  2. #include <math.h>
  3. using namespace std;
  4. int main()
  5. {
  6. double a,b,k=1, count=0;float q;
  7. cout<< "Enter A ";
  8. cin>>a;
  9. cout << "Enter B ";
  10. cin>>b;
  11. for (int i=a; i<=b;i++){
  12. k*=i;
  13. count++;
  14. }
  15.  
  16. cout << "Sum = " << k << "!\n";
  17. cout << "Count = " << count << "!\n";
  18. cout << "Avarage = " << pow(k, 1/count) << "!\n";
  19. }
Success #stdin #stdout 0s 15240KB
stdin
Standard input is empty
stdout
Enter A Enter B Sum = 0!
Count = 1!
Avarage = 0!