Dr_Lion Posted March 9, 2012 Report Share Posted March 9, 2012 Eu creio que já encontrei informação na net há uns anos, mas agora que procurei não encontrei nada. De qualquer maneira penso que está a funcionar, mas gostava de ter a certeza, e se alguém sabe como funciona para poder usar em casos futuros. o algoritmo seria algo do género. int MAX=100; int ocupados; int i; for (i=0; i<ocupados && i<MAX; i++) { if (i%2==0) ocupados++; } Este programa não tem própriamente nenhum objectivo, a ideia é mesmo só tentar perceber este for e se realmente funciona. Desde já obrigado a todos. Link to comment Share on other sites More sharing options...
KiNgPiTo Posted March 9, 2012 Report Share Posted March 9, 2012 Se estás a falar em ter 2 condições para o ciclo 'andar', sim, podes fazer isso... Link to comment Share on other sites More sharing options...
Dr_Lion Posted March 13, 2012 Author Report Share Posted March 13, 2012 Sim era isso, obrigado. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now