#include <iostream>;
using namespace std;
int main()
{
int a, b;
cout << "please inter number \n";
cin >> a ;
cout << "please inter number \n";
cin >> b ;
cout << "********\n" ;
float pi = 3.14 ;
float area = (pi*b*b/4) * ((2*a-b) / (2*a+b));
cout << area << endl;
return 0;
}
Asked
Active
Viewed 32 times
0

463035818_is_not_an_ai
- 109,796
- 11
- 89
- 185

Mahammad Qasm
- 21
- 3
-
2what is the input? What is expected output? – 463035818_is_not_an_ai Sep 26 '22 at 19:31
-
1`(2*a-b) / (2*a+b)` is using integer arithmetics – 463035818_is_not_an_ai Sep 26 '22 at 19:32
-
2why are `a` and `b` not `float` ? – 463035818_is_not_an_ai Sep 26 '22 at 19:32
-
@463035818_is_not_a_number make that an answer. – lorro Sep 26 '22 at 19:33
-
not a programming problem – Hariom Singh Sep 26 '22 at 19:33
-
The input for a and be is a=20, b=10 – Mahammad Qasm Sep 26 '22 at 19:36
-
@MahammadQasm -- *The input for a and be is a=20, b=10* -- But `a` and `b` are not `float`. Why did you make them `int`? It also makes more sense to make them `float` anyway, as why should the input not also be fractional, i.e. `2.3` or `5.9`? – PaulMcKenzie Sep 26 '22 at 19:39
-
463035818_is_not_a_number. Thanks the problem was using int instead of float in for a & b. – Mahammad Qasm Sep 26 '22 at 19:42