We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 627857c commit cfeb18aCopy full SHA for cfeb18a
desafios_em_c/desafio17.c
@@ -0,0 +1,44 @@
1
+// leia três valores do teclado e diga qual
2
+// é maior
3
+// função para leitura de valores e para
4
+// análise de qual é maior
5
+// COM FUNÇÕES
6
+
7
8
+#include <stdio.h>
9
10
+int leNumero() {
11
+ int numero;
12
13
+ printf("Digite um numero: ");
14
+ scanf("%d", &numero);
15
16
+ return numero;
17
+}
18
19
+int compara(int a, int b, int c) {
20
+ int maior;
21
22
+ maior = a;
23
+ if (b > maior)
24
+ maior = b;
25
+ if (c > maior)
26
+ maior = c;
27
28
+ return maior;
29
30
31
+int main() {
32
33
+ int a, b, c, maior;
34
35
+ a = leNumero();
36
+ b = leNumero();
37
+ c = leNumero();
38
39
+ maior = compara(a, b, c);
40
41
+ printf("Maior numero: %d", maior);
42
43
+ return 0;
44
0 commit comments