Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
ProgC
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Sandro Stephan Rufibach
ProgC
Commits
0ec72f6f
Commit
0ec72f6f
authored
6 months ago
by
Sandro Stephan Rufibach
Browse files
Options
Downloads
Patches
Plain Diff
fiborek.c erstellt
parent
f131a30b
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
P13/fiborek.c
+30
-0
30 additions, 0 deletions
P13/fiborek.c
P13/output/fiborek.exe
+0
-0
0 additions, 0 deletions
P13/output/fiborek.exe
with
30 additions
and
0 deletions
P13/fiborek.c
0 → 100644
+
30
−
0
View file @
0ec72f6f
// Praktikum 13, Aufgabe Nr. 2: Fibonacci-Zahl rekursiv
// Datei 'fiborek.c' 11.12.2024, Sandro Rufibach
//----------------------------------------------
#include
<stdio.h>
// Für scanf(), printf ()
unsigned
long
long
getfiborec
(
int
Anzahl
);
int
main
(
void
)
{
int
Anzahl
;
printf
(
"Heute Berechnen wir die Fibonacizahl, gib bitte die Anzahl stellen an die wir berechnen:"
);
scanf
(
"%d"
,
&
Anzahl
);
unsigned
long
long
Zahl
=
getfiborec
(
Anzahl
);
printf
(
"%llu
\n
"
,
Zahl
);
}
unsigned
long
long
getfiborec
(
int
Anzahl
)
{
if
(
Anzahl
<=
2
)
{
return
1
;
}
else
{
return
getfiborec
(
Anzahl
-
1
)
+
getfiborec
(
Anzahl
-
2
);
}
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
P13/output/fiborek.exe
0 → 100644
+
0
−
0
View file @
0ec72f6f
File added
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment