Skip to content
Snippets Groups Projects
Commit a9dddd70 authored by Adeline Pierrot's avatar Adeline Pierrot
Browse files

ajout des programmes du qcm du partiel 2013

parent bf3cf7af
No related branches found
No related tags found
No related merge requests found
#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;
}
#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;
}
#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;
}
#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;
}
#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;
}
#include <iostream>
using namespace std;
int main () {
int x, y;
x = 5*(2/5);
y = (5*2)/5;
cout << x << ", " << y << endl;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment