diff --git a/Exemples/equivBoucle.c b/Exemples/equivBoucle.c new file mode 100644 index 0000000..9ed1327 --- /dev/null +++ b/Exemples/equivBoucle.c @@ -0,0 +1,21 @@ +#include +#include + +int main (void) { + int i = 0; + int j = 0; + + while (C()) { + f(); + } + + if (C()) { + do { + f(); + } while (C()); + } + + for( ; C(); ) { + f(); + } +} \ No newline at end of file diff --git a/Exemples/semFor.c b/Exemples/semFor.c new file mode 100644 index 0000000..1641f5f --- /dev/null +++ b/Exemples/semFor.c @@ -0,0 +1,34 @@ +#include +#include + +int main (void) { + int i = 0; + + for (i = V1; conditionSur(i); i = f(i) ) { + calcul(); + } + /* Pareil que */ + i = V1; + for( ; conditionSur(i) ; i = f(i)) { + Calcul(); + } + /* Pareil que */ + for (i = V1; conditionSur(i); ) { + Calcul(); + i = f(i); + } + /* Pareil que */ + for (i = V1; ; i = f(i)) { + if (ConditionSur(i)) { + Calcul(); + } else { + break; + } + } + /* Pareil que */ + i = V1; + while (ConditionSur(i)) { + Calcul(); + i = f(i); + } +} \ No newline at end of file