Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #include <conio.h>
- int main()
- {
- float resp;
- printf ("pense um numero par de 2 ate 18. 0 - nao, 1 - sim\n");
- printf ("o numero e maior ou igual a 10?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e maior ou igual a 6?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e maior ou igual a 4?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 2?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 3.");
- }
- else if (resp = 1)
- {
- printf ("\n o numero e 2.");
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e 4?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 5.");
- }
- else if (resp = 1)
- {
- printf ("\n o numero e 4.");
- }
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e maior ou igual a 8?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 6?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 7.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 6.");
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e 8?");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero é 9.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 8.");
- }
- }
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e maior ou igual a 14?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e maior ou igual a 12?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 10?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 11.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 10.");
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e 12?: ");
- scanf ("%d", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 13.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 12.");
- }
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e maior ou igual a 16?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e igual a 14?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 15.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 14.");
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e 16?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 17?: ");
- scanf ("%f", &resp);
- if (resp == 0)
- {
- printf ("\no numero e 18.");
- }
- else if (resp == 1)
- {
- printf ("\no numero e 17.");
- }
- }
- else if (resp == 1)
- {
- printf ("\no numero e 16.");
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement