السلام عليكم ورحمة الله وبركاته
اخواني في الله
أريد منكم مساعده في تصحيح كودي
أولا اليكم السؤال :
Question:-
There are 9870 people in a town whose population increases by 10% each year, write a program that print how many years it would take for the population to exceed 30000.
Output sample:-
Population will reach 30000 after 12 years
#include <iostream>
using namespace std ;
int main ()
{
int p = 9870 ;
while (p!=30000 )
{
p = p +(10 /100)*p;
p++;
}
cout << "Population will reach " << p << " after 12 years" ;
return 0 ;
}ما هي العلميه الي تخرج لنا قيمه 12
و جزيتم خيرا
