diff --git a/test~coding~readingCppPrograms.fr/data/function_call_3.cpp b/test~coding~readingCppPrograms.fr/data/function_call_3.cpp new file mode 100644 index 0000000000000000000000000000000000000000..65eff79d5940b2d80783ad5c8aac2e9bde3f5dd2 --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/function_call_3.cpp @@ -0,0 +1,15 @@ +#include <iostream> +using namespace std; + +void f(int x, int y) { + x = x+1; + y = y-1; +} + +int main() { + int x,y; + x = 1; + y = 2; + f(y,x); + cout << x << ", " << y << endl; +} diff --git a/test~coding~readingCppPrograms.fr/data/function_call_4.cpp b/test~coding~readingCppPrograms.fr/data/function_call_4.cpp new file mode 100644 index 0000000000000000000000000000000000000000..7e069b3cb831f96d29511939b245cdaa21b047c4 --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/function_call_4.cpp @@ -0,0 +1,15 @@ +#include <iostream> +using namespace std; + +int g(int x, int y) { + x = x+1; + return y-1; +} + +int main() { + int x,y; + x = 1; + y = 2; + g(x,y); + cout << x << ", " << y << endl; +} diff --git a/test~coding~readingCppPrograms.fr/data/function_inversion_arguments.cpp b/test~coding~readingCppPrograms.fr/data/function_inversion_arguments.cpp new file mode 100644 index 0000000000000000000000000000000000000000..99c714ff01fb9bcad5cdfba27c12a63ca2a6982c --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/function_inversion_arguments.cpp @@ -0,0 +1,15 @@ +#include <iostream> +using namespace std; + +int f(int x, int y) { + x = x+1; + return y-1; +} + +int main() { + int x,y; + x = 1; + y = 2; + x = f(y,x); + cout << x << ", " << y << endl; +} diff --git a/test~coding~readingCppPrograms.fr/data/if_oppose.cpp b/test~coding~readingCppPrograms.fr/data/if_oppose.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89d8f214df0df21f65f1f2d566b4d0e584815fa1 --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/if_oppose.cpp @@ -0,0 +1,14 @@ +#include <iostream> +using namespace std; + +int main () { + int x, y; + y = -3; + x = -y; + if ( y > 0 ) { + y = 2*x; + } else { + y = -y; + } + cout << x << ", " << y << endl; +} diff --git a/test~coding~readingCppPrograms.fr/data/loop_while_accumulateur.cpp b/test~coding~readingCppPrograms.fr/data/loop_while_accumulateur.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c026bc28b4a7aace89ee0ef37764089069e57677 --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/loop_while_accumulateur.cpp @@ -0,0 +1,13 @@ +#include <iostream> +using namespace std; + +int main () { + int x, y; + x = 0; + y = 0; + while ( x < 10 ) { + x = x + 1; + y = 1; + } + cout << x << ", " << y << endl; +} diff --git a/test~coding~readingCppPrograms.fr/data/variable_division_entiere.cpp b/test~coding~readingCppPrograms.fr/data/variable_division_entiere.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f61dabec7d8a68d1cbf24366f6a428597328c7f3 --- /dev/null +++ b/test~coding~readingCppPrograms.fr/data/variable_division_entiere.cpp @@ -0,0 +1,9 @@ +#include <iostream> +using namespace std; + +int main () { + int x, y; + x = 5*(2/5); + y = (5*2)/5; + cout << x << ", " << y << endl; +}