Skip to content
Snippets Groups Projects
Commit f96adb90 authored by Peter Gerwinski's avatar Peter Gerwinski
Browse files

Noch ein Beispiel-Programm Übungsaufgaben 14.11.2019

parent bf4eab56
Branches
No related tags found
No related merge requests found
#include <string.h>
int fun_1 (char *s)
{
int x = 0;
for (int i = 0; i < strlen (s); i++)
x += s[i];
return x;
}
int fun_2 (char *s)
{
int i = 0, x = 0;
int len = strlen (s);
while (i < len)
x += s[i++];
return x;
}
No preview for this file type
......@@ -59,7 +59,7 @@
\exercise{Einfügen in Strings}
Wir betrachten das folgende Programm (\file{aufgabe-2.c}):
Wir betrachten das folgende Programm (\gitfile{hp}{20191114}{aufgabe-2.c}):
% \begin{lstlisting}[style=numbered]
\begin{lstlisting}
#include <stdio.h>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment