Skip to content
Snippets Groups Projects
Commit af8b0607 authored by Sandro Stephan Rufibach's avatar Sandro Stephan Rufibach
Browse files

Optimierungen aufgrund Zusammenfassung

parent 0ec72f6f
Branches
No related tags found
No related merge requests found
......@@ -15,5 +15,4 @@ int main (void)
zeit = sqrt((2*(absprunghoehe-650))/erdanziehung);
printf("Die Zeit beträgt: %lf", zeit);
return 0;
}
\ No newline at end of file
File added
File added
// Datei : sekunden.c
// Sekunden umrechnen
// R. Bonderer, 24.09.2015
#include <stdio.h>
int main(void)
{
int nSek; // Anzahl eingegebene Sekunden
int std;
int min;
int sek;
printf("Bitte Anzahl Sekunden (>=0) eingeben: ");
scanf("%d", &nSek);
sek = nSek % 60; // Anzahl verbleibende Sekunden (0..59)
min = nSek / 60; // Anzahl ganze Minuten (Ganzzahldivision!)
std = min / 60; // Anzahl ganze Stunden
min = min % 60; // Anzahl verbleibende Minuten (0..59)
printf("%d Sekunden sind %d Std %d Min %d Sek. \n", nSek, std, min, sek);
printf("%d:%d:%d\n", std, min, sek);
return 0;
}
\ No newline at end of file
// Datei: multab.c
// stellt eine Multiplikationstabelle dar
// R. Bonderer, 06.10.2017
#include <stdio.h>
int main(void)
{
for (int zeile = 1; zeile <= 10; ++zeile)
{
for (int spalte = 1; spalte <= 10; ++spalte)
{
printf("%3d ", zeile*spalte);
}
printf("\n");
}
return 0;
}
\ No newline at end of file
File added
......@@ -6,13 +6,8 @@
#include <math.h> // Für sqrt
// Funktion definieren
double getHypotenuse (double x, double y) // x und y sind interne Variabeln nur für Funktion
{
double hypo;
hypo = sqrt(x*x + y*y);
return hypo;
}
double getHypotenuse (double x, double y); // x und y sind interne Variabeln nur für Funktion
int main (void)
{
double zahl1; // x und Zahl1 haben nichts miteinander zu tun, darum in main Funktion Variabel neu definieren
......@@ -26,4 +21,9 @@ int main (void)
printf("Die Hypothenuse betraegt %.2f \n", hypothenuse); //.2 für Zweinachkommastellen
}
\ No newline at end of file
}
double getHypotenuse (double x, double y) // x und y sind interne Variabeln nur für Funktion
{
double hypo = sqrt(x*x + y*y);
return hypo;
}
\ No newline at end of file
No preview for this file type
No preview for this file type
// Praktikum 13, Aufgabe Nr. 13: Fibonacci-Zahl iterativ
// Datei 'fiboit.c', 11.12.2024, Sandro Rufibach
//----------------------------------------------
#include <stdio.h> // Für scanf(), printf ()
int main (void)
{
}
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment