Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
inlab_assignment_4
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
codebudgies
inlab_assignment_4
Commits
aadd25f8
Commit
aadd25f8
authored
Aug 10, 2017
by
MUDE CHAITHANYA NAIK
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Upload new file
parent
dfa0e048
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
0 deletions
+31
-0
lab1/program1.cpp
lab1/program1.cpp
+31
-0
No files found.
lab1/program1.cpp
0 → 100644
View file @
aadd25f8
#include <iostream>
using
namespace
std
;
double
fib
(
int
n
){
if
(
n
==
0
){
return
0
;
}
else
if
(
n
==
1
){
return
1
;
}
else
{
return
fib
(
n
-
1
)
+
fib
(
n
-
2
);
}
}
int
main
(){
int
n
;
cin
>>
n
;
double
a
=
0
,
b
=
1
;
for
(
int
i
=
0
;
i
<
n
;
i
++
){
a
=
a
+
b
;
b
=
a
-
b
;
a
=
a
-
b
;
a
=
a
+
b
;
}
cout
<<
a
<<
endl
;
cout
<<
fib
(
n
)
<<
endl
;
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment