Skip to content
Snippets Groups Projects
Commit 5a186cd6 authored by Nicolas M. Thiéry's avatar Nicolas M. Thiéry
Browse files

WIMS: oef with two programs

parent eba8e984
No related branches found
No related tags found
No related merge requests found
......@@ -4,27 +4,49 @@
\email{Nicolas.Thiery@u-psud.fr}
\format{html}
\text{code=
\text{programName=random(if-semicolon.cpp, function-max.cpp)}
\text{code= \programName issametext if-semicolon.cpp ?
#include <iostream>
using namespace std;
int main() {
int x = 1+2;
if ( x == 3 ); {
cout << "Bonjour!" << endl;
cout << "Bonjour!" << endl;
}
cout << "Au revoir." << endl;
return 0;
}
}
\text{code= \programName issametext function-max.cpp ?
#include <iostream>
using namespace std;
float max(float a, float b) {
if ( a >= b ) {
return a;
} else {
return b;
}
}
int main() {
cout << max(1.0, 3.0) << endl;
cout << max(5.0, 2.0) << endl;
cout << max(2.0, 2.0) << endl;
return 0;
}
}
\text{output=
42
}
\statement{
<p>
Qu'affiche le programme suivant?
On considre le programme C++ suivant:
<hr>
<pre>
\special{expandlines \code}
......@@ -32,4 +54,4 @@ Qu'affiche le programme suivant?
<hr>
}
\answer{La longueur}{\output}{type=text}
\answer{Qu'affiche-t'il?}{\output}{type=text}
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