Skip to content

Commit

Permalink
1004 C refatora
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasPLopes committed Dec 17, 2019
1 parent 8bcda45 commit 1ce70c0
Showing 1 changed file with 17 additions and 3 deletions.
20 changes: 17 additions & 3 deletions C/1004.c
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
#include <stdio.h>

void ler(int *a, int *b)
{
scanf("%i%i", &(*a), &(*b));
}
int mult(int *a, int *b)
{
return *a * *b;
}
void imprime(int *c)
{
char *msg = "PROD = %i\n";
printf(msg, *c);
}

int main()
{

int a, b, c = 0;
scanf("%i%i", &a, &b);
c = a * b;
printf("PROD = %i\n", c);
ler(&a, &b);
c = mult(&a, &b);
imprime(&c);
return 0;
}

0 comments on commit 1ce70c0

Please sign in to comment.