Solution Devoir TP CPP
Solution Devoir TP CPP
Préparé par:
Hatym Laaboudi
Numéro : 16
TP 1
Exercice 1
int main() {
sum = a + b + c + d;
return 0;
Exercice 2
int main() {
return 0;
}
Exercice 3
int main() {
char c;
c = getchar();
return 0;
Exercice 4
int main() {
int A, B, C, temp;
temp = A; A = B; B = C; C = temp;
C);
return 0;
Exercice 5
int main() {
return 0;
TP 2
Exercice 1
int main() {
int produit = 0;
return 0;
}
Exercice 2
int main() {
return 0;
}
TP 3
Exercice 1
return (a + b) / 2;
int main() {
float x, y;
printf("moyenne: %.2f\n",
return 0;
Exercice 2
float min(float a, floa b) { return (a < b) ? a : b;
main() {
float w, x, y, z;
printf("Min: %.2f, Max: %.2f\n", min(min(w, x), min(y, z)), max(max(w, x), max(y, z)));
return 0;
}
TP 4
Exercice 2
int main() {
P1++; P2--;
return 0;