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

Wintersemester 2023/24

parent ae93ac07
No related branches found
No related tags found
No related merge requests found
Showing
with 0 additions and 218 deletions
../common/logo-hochschule-bochum.pdf
\ No newline at end of file
../common/pgscript.sty
\ No newline at end of file
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
int *p = prime;
for (int i = 0; i < 5; i++)
printf ("%d\n", *(p + i));
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
int *p = prime;
for (int i = 0; i < 5; i++)
printf ("%d\n", p[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
for (int i = 0; i < 5; i++)
printf ("%d\n", prime[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
for (int *p = prime; p < prime + 5; p++)
printf ("%d\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
for (int *p = prime; p <= prime + 5; p++)
printf ("%d\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[5] = { 2, 3, 5, 7, 11 };
for (int i = 0; i <= 5; i++)
printf ("%d\n", prime[i]);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[6] = { 2, 3, 5, 7, 11, 0 };
for (int *p = prime; *p; p++)
printf ("%d\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 0 };
for (int *p = prime; *p; p++)
printf ("%d\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
int prime[15] = { 2, 3, 5, 7, 11, 13, 17, 19, 23, 0 };
for (int *p = prime; *p; p++)
printf ("%d\n", *p);
prime[9] = 29;
prime[10] = 0;
for (int *p = prime; *p; p++)
printf ("%d\n", *p);
return 0;
}
#include <stdio.h>
int main (void)
{
for (int i = 10; i = 0; i - 1)
printf ("%d\n", i);
return 0;
}
#include <stdio.h>
void hello ()
{
printf ("Hello, world!\n");
}
int main ()
{
hello ();
return 0;
}
#include <stdio.h>
void hello ()
{
printf ("Hello, world!\n");
}
int main ()
{
hello ("Hallo, Welt!\n");
return 0;
}
#include <stdio.h>
void hello (void)
{
printf ("Hello, world!\n");
}
int main (void)
{
hello ("Hallo, Welt!\n");
return 0;
}
#include <stdio.h>
void philosophy (a)
int a;
{
printf ("The answer is: %d.\n", a);
}
int main (void)
{
philosophy (137);
return 0;
}
#include <stdio.h>
void philosophy (a)
int a;
{
printf ("The answer is: %d.\n", a);
}
int main (void)
{
philosophy ("Hello, world!\n");
return 0;
}
#include <stdio.h>
void philosophy (a)
int a;
{
printf ("The answer is: %d.\n", a);
}
int main (void)
{
philosophy ("Hello, world!\n");
return 0;
}
cassini/home/peter/bo/2022ws/hp/20221010> gcc -Wall -O functions-05.c -o functions-05
cassini/home/peter/bo/2022ws/hp/20221010> ./functions-05
The answer is: -1434640360.
cassini/home/peter/bo/2022ws/hp/20221010> ./functions-05
The answer is: -402571240.
cassini/home/peter/bo/2022ws/hp/20221010> ./functions-05
The answer is: 588369944.
cassini/home/peter/bo/2022ws/hp/20221010> ./functions-05
The answer is: 97824792.
cassini/home/peter/bo/2022ws/hp/20221010>
#include <stdio.h>
void philosophy (int a)
{
printf ("The answer is: %d.\n", a);
}
int main (void)
{
philosophy ("Hello, world!\n");
return 0;
}
#include <stdio.h>
int a, b = 3;
void foo (void)
{
b++;
static int a = 5;
int b = 7;
printf ("foo(): " "a = %d, b = %d\n", a, b);
a++;
}
int main (void)
{
printf ("main(): " "a = %d, b = %d\n", a, b);
return 0;
foo ();
printf ("main(): " "a = %d, b = %d\n", a, b);
a = b = 12;
printf ("main(): " "a = %d, b = %d\n", a, b);
foo ();
printf ("main(): " "a = %d, b = %d\n", a, b);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment