122k views
1 vote
Write a program in C++ to calculate zakat (cows).

1 Answer

5 votes

Answer:

Here is an example program in C++ to calculate zakat on cows:

```

#include <iostream>

using namespace std;

int main() {

double n, p, zakat;

cout << "Enter the number of cows you own: ";

cin >> n;

cout << "Enter the price of one cow in your currency: ";

cin >> p;

zakat = (n * p * 0.025);

cout << "Your zakat on cows is: " << zakat << endl;

return 0;

}

```

This program takes two inputs from the user: the number of cows they own and the price of one cow in their currency. It then calculates the zakat on cows using the formula zakat = (n * p * 0.025), where n is the number of cows and p is the price of one cow. The zakat is then displayed to the user.

User JoannisO
by
7.7k points

Related questions

asked May 23, 2024 92.2k views
Blong asked May 23, 2024
by Blong
7.7k points
1 answer
5 votes
92.2k views
asked Jan 23, 2024 234k views
Jroith asked Jan 23, 2024
by Jroith
8.1k points
1 answer
3 votes
234k views