9511_workbook

solved exercises from algorithms & programming I (9511) prof. Cardozo
Index Commits Files Refs README
commit 0b3cdc1840f4709669f0ae9438fcde463cdf3a80
parent 991015b3c594ed5d219617e65ec8528031ebd85b
Author: klewer-martin <martin.cachari@gmail.com>
Date:   Wed, 24 Mar 2021 17:38:15 -0300

Update: Added ex35.c (not working yet) & ex40c;

Diffstat:
Aguia03/ex35.c | 28++++++++++++++++++++++++++++
Aguia03/ex40.c | 11+++++++++++
2 files changed, 39 insertions(+), 0 deletions(-)
diff --git a/guia03/ex35.c b/guia03/ex35.c
@@ -0,0 +1,28 @@
+#include <stdio.h>
+#include <math.h>
+
+#define PI 3.1415922654
+
+int main (void)
+{
+    size_t i, samples, interval;
+    double amp, frequency, time, phi;
+
+    amp = 100;
+    frequency = 20;
+    time = 0;
+    phi = 0.1;
+
+    samples = 10;
+    interval = 1;
+
+    double data[samples];
+
+    for(i = 0; i < samples; i++, time += interval) {
+        data[i] = (amp * sin((2 * PI * frequency * time) + phi));
+//        printf("data: %ld\n", data[i]);
+        printf("sin: %ld\n", sin((2 * PI * frequency * time) + phi));
+    }
+
+    return 0;
+}
diff --git a/guia03/ex40.c b/guia03/ex40.c
@@ -0,0 +1,11 @@
+#include <stdio.h>
+
+int main ( void )
+{
+/*      N de arreglos | N caracteres en el arreglo    */
+        char cadd[3][10] = {"dia", "mes", "año"};
+
+    printf("%s\n", cadd[1]);
+
+    return 0;
+}