Jump to content
ralmeidasantos

Receber e mostrar valores

Recommended Posts

ralmeidasantos

Boas, pessoal estou com um problema na execução deste programa 

Citação

Write a program to calculate the number of generations of growing bacteria.

The program should do the following:

i) Ask the user the initial number of bacteria in a tube.

ii) Ask the user the final number of bacteria in the tube.

iii) Then calculate the approximate number of generations as Log2(NumberFinal/NumberInitial)

iv) Write in the screen: The number of generations is (number)

Eu tentei assim 

number_initial=input('Initial number of bacteria in the tube \n');
number_final=input('Final number of bacteria in the tube \n');
Gen=log2(NumberFinal/NumberInitial);
fprintf('The number of generations is (number)');

HTML Master

The programs change the world

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...

Important Information

By using this site you accept our Terms of Use and Privacy Policy. We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.