aboutsummaryrefslogtreecommitdiff
path: root/semestre 2/informatique/td/1- exemples/printf.c
diff options
context:
space:
mode:
Diffstat (limited to 'semestre 2/informatique/td/1- exemples/printf.c')
-rw-r--r--semestre 2/informatique/td/1- exemples/printf.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/semestre 2/informatique/td/1- exemples/printf.c b/semestre 2/informatique/td/1- exemples/printf.c
new file mode 100644
index 0000000..f40921f
--- /dev/null
+++ b/semestre 2/informatique/td/1- exemples/printf.c
@@ -0,0 +1,14 @@
+#include <stdio.h>
+
+float mult(int op1, float op2){
+ return op1 * op2;
+}
+
+int main(){
+ int op1 = 3;
+ float op2 = 2.7;
+
+ printf("%d * %f = %f\n", op1, op2, mult(op1, op2));
+
+ return 0;
+}