#include<stdio.h>
#include<stdlib.h>

main(){
	float popA = 80000, popB = 200000;
	int numanos = 0;
	
	do{
	   popA = popA + (popA * 0.03);
	   popB = popB*1.015;
	   numanos++;
	}while(popA<popB);
	
	printf("Populacao A =%f \n\nPopulacao B =%f",popA, popB);
	printf("\n\nA quantidade anos necessarios foram %i anos",numanos);
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: