Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions session_1/solution/Question 1/question_1/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Files and directories created by pub.
.dart_tool/
.packages

# Conventional directory for build output.
build/
13 changes: 13 additions & 0 deletions session_1/solution/Question 1/question_1/.vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "question_1",
"request": "launch",
"type": "dart"
}
]
}
3 changes: 3 additions & 0 deletions session_1/solution/Question 1/question_1/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## 1.0.0

- Initial version.
2 changes: 2 additions & 0 deletions session_1/solution/Question 1/question_1/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
A sample command-line application with an entrypoint in `bin/`, library code
in `lib/`, and example unit test in `test/`.
30 changes: 30 additions & 0 deletions session_1/solution/Question 1/question_1/analysis_options.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This file configures the static analysis results for your project (errors,
# warnings, and lints).
#
# This enables the 'recommended' set of lints from `package:lints`.
# This set helps identify many issues that may lead to problems when running
# or consuming Dart code, and enforces writing Dart using a single, idiomatic
# style and format.
#
# If you want a smaller set of lints you can change this to specify
# 'package:lints/core.yaml'. These are just the most critical lints
# (the recommended set includes the core lints).
# The core lints are also what is used by pub.dev for scoring packages.

include: package:lints/recommended.yaml

# Uncomment the following section to specify additional rules.

# linter:
# rules:
# - camel_case_types

# analyzer:
# exclude:
# - path/to/excluded/files/**

# For more information about the core and recommended set of lints, see
# https://dart.dev/go/core-lints

# For additional information about configuring this file, see
# https://dart.dev/guides/language/analysis-options
45 changes: 45 additions & 0 deletions session_1/solution/Question 1/question_1/bin/question_1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// import 'package:question_1/question_1.dart' as question_1;
import 'dart:io';


void fibonacci(int n){

if(n<=0){
print("Entered numbered should be greater than zero");
return;
}

int f0=0,f1=1,result=0, count=0;

if(n==1){
print('0');
return;
}
else{
print('0');
print('1');
if(n==2){
return;
}
}
count=2;
result = f0+f1;

while(count<n){
result=f0+f1;
f0=f1;
f1=result;
print('$result');
count+=1;
}
return;
}

void main() {

print("Enter the number till which the Fibonacci series should be printed:");

int? number = int.parse(stdin.readLineSync()!);

fibonacci(number);
}
3 changes: 3 additions & 0 deletions session_1/solution/Question 1/question_1/lib/question_1.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
int calculate() {
return 6 * 7;
}
Loading