Skip to content
Snippets Groups Projects
Select Git revision
  • 2023ws
  • 2024ws default
  • 2022ws
  • 2021ws
  • 2020ws
  • 2018ws
  • 2019ws
  • 2017ws
  • 2016ws
9 results

loesung-1a.c

Blame
  • loesung-1a.c 354 B
    #include <stdio.h>
    #include <math.h>
    
    int main (void)
    {
      double C = 0.0001;
      double U0 = 5.0;
      double U = U0;
      double R = 33000.0;
      double t = 0.0;
      double dt = 0.01;
      double Q = C * U;
      while (U > 0.09)
        {
          printf ("%10.3lf%15.8lf\n", t, U);
          double I = U / R;
          Q -= I * dt;
          U = Q / C;
          t += dt;
        }
      return 0;
    }