]> web.ist.utl.pt Git - iaed.git/commitdiff
Add aula01/*.
authorAlexandre P Francisco <aplf@tecnico.pt>
Tue, 23 Feb 2016 15:27:05 +0000 (15:27 +0000)
committerAlexandre P Francisco <aplf@tecnico.pt>
Tue, 23 Feb 2016 15:27:05 +0000 (15:27 +0000)
aula01/ct.c [new file with mode: 0644]
aula01/hello.c [new file with mode: 0644]

diff --git a/aula01/ct.c b/aula01/ct.c
new file mode 100644 (file)
index 0000000..68ada24
--- /dev/null
@@ -0,0 +1,21 @@
+#include <stdio.h>
+
+/* Conversao Fahrenheit-Celsius */
+
+#define INFERIOR 0
+#define SUPERIOR 300
+#define PASSO 20
+
+int main ()
+{
+  double fahr, celsius;
+
+  fahr = INFERIOR;
+  while (fahr <= SUPERIOR) 
+  {
+    celsius = 5 * (fahr-32) / 9;
+    printf("%5.1lf\t%6.2lf\n", fahr, celsius);
+    fahr = fahr + PASSO;
+  }
+  return 0;
+}
diff --git a/aula01/hello.c b/aula01/hello.c
new file mode 100644 (file)
index 0000000..abc6028
--- /dev/null
@@ -0,0 +1,7 @@
+#include <stdio.h>
+#include <stdlib.h>
+
+int main() {
+    printf("Olá mundo!\n");
+    return EXIT_SUCCESS;
+}