#include <stdio.h>
int quant(int num1, int num2) {
return num1 < num2 ? quant(num1 + 1, num2) + (num1 % 2 == 0) : 0;
}
int main(int argc, char** argv) {
int n1,n2;
printf("Digite o primeiro numero: "); printf("Digite o segundo numero, maior que o primeiro: "); printf("A quantidade de pares entre %d e %d e' %d", n1
, n2
, quant
(n1
, n2
)); return 0;
}
//https://pt.stackoverflow.com/q/286773/101
I2luY2x1ZGUgPHN0ZGlvLmg+CgppbnQgcXVhbnQoaW50IG51bTEsIGludCBudW0yKSB7CiAgICByZXR1cm4gbnVtMSA8IG51bTIgPyBxdWFudChudW0xICsgMSwgbnVtMikgKyAobnVtMSAlIDIgPT0gMCkgOiAwOwp9CgppbnQgbWFpbihpbnQgYXJnYywgY2hhcioqIGFyZ3YpIHsKICAgIGludCBuMSxuMjsKICAgIHByaW50ZigiRGlnaXRlIG8gcHJpbWVpcm8gbnVtZXJvOiAiKTsKICAgIHNjYW5mKCIlZCIsICZuMSk7CiAgICBwcmludGYoIkRpZ2l0ZSBvIHNlZ3VuZG8gbnVtZXJvLCBtYWlvciBxdWUgbyBwcmltZWlybzogIik7CiAgICBzY2FuZigiJWQiLCAmbjIpOwogICAgcHJpbnRmKCJBIHF1YW50aWRhZGUgZGUgcGFyZXMgZW50cmUgJWQgZSAlZCBlJyAlZCIsIG4xLCBuMiwgcXVhbnQobjEsIG4yKSk7CiAgICByZXR1cm4gMDsKfQoKLy9odHRwczovL3B0LnN0YWNrb3ZlcmZsb3cuY29tL3EvMjg2NzczLzEwMQ==