Guest tsenart Posted November 24, 2006 at 08:28 PM Report #66478 Posted November 24, 2006 at 08:28 PM Olá pessoal... Estava aqui a fazer este programa-exercicio visto que estou a aprender e dá-me o seguinte erro de compilação.... C:\~\Exercs\exerc0410.c In function `main': Linha:22 C:\\Exercs\exerc0410.c syntax error before "printf" #include <stdio.h> main() { int num; char ans='y'; while (ans=='y') do { do { printf("Introduza um numero "); scanf("%d",&num); if (num>=1 && num<=100) printf("%d esta entre 1 e 100\n",num); else printf("%d nao esta entre 1 e 100\n",num); } while(num<1 || num>100); } printf("Quer repetir? (y or n) "); scanf("%c",&ans); } Any help? 🙂
Hipnoted Posted November 24, 2006 at 08:31 PM Report #66480 Posted November 24, 2006 at 08:31 PM Tens um do a mais while (ans=='y') do (ESTE) { do PS: Curti o título do post. "Problema problemático." 🙂 EDIT: O último printf tem de estar antes de fechar a chaveta, entre o ciclo while. "Nunca discutas com um idiota. Eles arrastam-te até ao seu nível e depois ganham-te em experiência"
Guest tsenart Posted November 24, 2006 at 08:52 PM Report #66484 Posted November 24, 2006 at 08:52 PM Thankz 🙂
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