Skip to content
Snippets Groups Projects
Commit f3490b19 authored by adrian.spycher's avatar adrian.spycher
Browse files

add ex04

parent c81d16c2
No related branches found
No related tags found
No related merge requests found
......@@ -6,8 +6,31 @@
#include <stdlib.h>
#include <stdio.h>
#define MAX_TABLE 12
void print_table(int base, int current)
{
int next = current + base;
int div = next / base;
printf("%d * %d = %d\n", base, div, next);
if (next != base * MAX_TABLE)
{
print_table(base, next);
}
}
int main()
{
int entier;
printf("Entier : ");
if (scanf("%d", &entier) != 1)
{
return -1;
}
printf("Table:\n");
print_table(entier, 0);
return 0;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment