From 9837e311c844fed4be90001fd44495eab00ca835 Mon Sep 17 00:00:00 2001 From: Naufal Rachmandani <5174397-NaufalRachmandani@users.noreply.gitlab.com> Date: Sun, 10 Oct 2021 23:33:37 +0700 Subject: [PATCH 1/6] add basic filter function in kotlin --- kotlin/Program3/README.md | 1 + kotlin/Program3/filterList.kt | 19 +++++++++++++++++++ kotlin/README.md | 3 ++- 3 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 kotlin/Program3/README.md create mode 100644 kotlin/Program3/filterList.kt diff --git a/kotlin/Program3/README.md b/kotlin/Program3/README.md new file mode 100644 index 00000000..11c8cce9 --- /dev/null +++ b/kotlin/Program3/README.md @@ -0,0 +1 @@ +Write a program to filter number from list in kotlin diff --git a/kotlin/Program3/filterList.kt b/kotlin/Program3/filterList.kt new file mode 100644 index 00000000..ef4a373a --- /dev/null +++ b/kotlin/Program3/filterList.kt @@ -0,0 +1,19 @@ +fun main(args: Array) { + println("Basic Filter List Function") + val numbers = listOf(1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20) + val odd = numbers.filter { it % 2 != 0 } + val even = numbers.filter { it % 2 == 0 } + val moreThan10 = numbers.filter { it > 10 } + + println("odd: $odd") + println("even: $even") + println("moreThan10: $moreThan10") + + val listDay= listOf("Senin","Selasa","Senin","Kamis","Jumat","Sabtu","Minggu") + val containsS = listDay.filter { it.contains("s") } + val equal = listDay.filter { it == "Selasa" } + val length = listDay.filter { it.length > 5 } + println("contains S: $containsS") + println("equal: $equal") + println("length: $length") +} \ No newline at end of file diff --git a/kotlin/README.md b/kotlin/README.md index 73c15c50..2e77bcaf 100644 --- a/kotlin/README.md +++ b/kotlin/README.md @@ -4,6 +4,7 @@ | Program No.| Question | | ------- | ------ | | [Program-1](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/kotlin/Program1/pattern.kt) | Write a program to print half pyramid using ' * ' -| [Program-2](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/kotlin/Program2/extension.kt) | Q2. Write a program to plus and minus with sample of extension function from kotlin +| [Program-2](https://github.com/swaaz/basicprograms/blob/master/kotlin/Program2/extension.kt) | Q2. Write a program to plus and minus with sample of extension function from kotlin +| [Program-3](https://github.com/swaaz/basicprograms/blob/master/kotlin/Program3/filterList.kt) | Write a program to filter number from list in kotlin From 5d02bc05fbaa6c7abf3d01e755019d88b4a377c5 Mon Sep 17 00:00:00 2001 From: ARYAN706 Date: Mon, 11 Oct 2021 12:13:38 +0530 Subject: [PATCH 2/6] ADDED THE README FILE --- C++/Program 28/README.md | 1 + C++/Program 28/menu driven linear search.cpp | 89 ++++++++++++++++++++ 2 files changed, 90 insertions(+) create mode 100644 C++/Program 28/README.md create mode 100644 C++/Program 28/menu driven linear search.cpp diff --git a/C++/Program 28/README.md b/C++/Program 28/README.md new file mode 100644 index 00000000..53362909 --- /dev/null +++ b/C++/Program 28/README.md @@ -0,0 +1 @@ +program for linear search using menu driven program \ No newline at end of file diff --git a/C++/Program 28/menu driven linear search.cpp b/C++/Program 28/menu driven linear search.cpp new file mode 100644 index 00000000..1e5c16d2 --- /dev/null +++ b/C++/Program 28/menu driven linear search.cpp @@ -0,0 +1,89 @@ +#include +using namespace std; +#define R 3 +#define C 3 +int enter(int arr[R][C], int r, int c) +{ + + for(int i=0; i>arr[i][j]; + } + } +} +int display(int arr[R][C], int r, int c) +{ + cout<<".................the matrix is ................"<>item; + + for(int i=0; i>ch; + switch(ch) + { + case 1 : + { + enter(arr,R,C); + break; + } + case 2: + { + display(arr,R,C); + break; + } + case 3: + { + search(arr,R,C); + break; + } + default: + { + cout<<"invalid choice"; + } + } +} + while(ch!=3); + return 0; +} + + + + From edbe786b169f056690dd9a8a45b084aafe34b782 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 12 Oct 2021 20:16:59 +0530 Subject: [PATCH 3/6] C program --- C/README.md | 2 +- C/program-83/program-83.c | 49 +++++++++++++++++++++++++++++++++++++++ C/program-83/readme.md | 1 + 3 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 C/program-83/program-83.c create mode 100644 C/program-83/readme.md diff --git a/C/README.md b/C/README.md index 72058de2..e04a35b8 100644 --- a/C/README.md +++ b/C/README.md @@ -82,7 +82,7 @@ | [Program-78](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-78/program.c) | Program to find the Area of Triangle using Base and Height | [Program-79](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-79/program.c) | Program to calculate Simple Interest | [Program-80](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-80/program.c) | Program to calulate all the prime between the range of numbers - +| [Program-83](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-80/program.c) | Program to multiply two matrices
diff --git a/C/program-83/program-83.c b/C/program-83/program-83.c new file mode 100644 index 00000000..96fb8745 --- /dev/null +++ b/C/program-83/program-83.c @@ -0,0 +1,49 @@ +#include +#include +int main(){ +int a[10][10],b[10][10],mul[10][10],r,c,i,j,k; +system("cls"); +printf("enter the number of row="); +scanf("%d",&r); +printf("enter the number of column="); +scanf("%d",&c); +printf("enter the first matrix element=\n"); +for(i=0;i Date: Tue, 12 Oct 2021 20:18:34 +0530 Subject: [PATCH 4/6] update --- C/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/C/README.md b/C/README.md index e04a35b8..44dce70e 100644 --- a/C/README.md +++ b/C/README.md @@ -82,7 +82,7 @@ | [Program-78](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-78/program.c) | Program to find the Area of Triangle using Base and Height | [Program-79](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-79/program.c) | Program to calculate Simple Interest | [Program-80](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-80/program.c) | Program to calulate all the prime between the range of numbers -| [Program-83](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-80/program.c) | Program to multiply two matrices +| [Program-83](https://github.com/swaaz/basicprograms/blob/814a1e60ae23d81158d8174666f23c9b7419e15e/C/program-83/program-83.c) | Program to multiply two matrices
From 8b35066f8d25d9feb23f75fb361a367a0bd73ab9 Mon Sep 17 00:00:00 2001 From: Avni Shyam Date: Fri, 15 Oct 2021 11:31:32 +0530 Subject: [PATCH 5/6] update --- Python/Program43/Program43 | 0 Python/Program43/Readme.md | 1 + 2 files changed, 1 insertion(+) create mode 100644 Python/Program43/Program43 create mode 100644 Python/Program43/Readme.md diff --git a/Python/Program43/Program43 b/Python/Program43/Program43 new file mode 100644 index 00000000..e69de29b diff --git a/Python/Program43/Readme.md b/Python/Program43/Readme.md new file mode 100644 index 00000000..546c9507 --- /dev/null +++ b/Python/Program43/Readme.md @@ -0,0 +1 @@ +# Display the powers of 2 using anonymous function \ No newline at end of file From ab9f2971b0b6c8c4506f342179300a392065b3cf Mon Sep 17 00:00:00 2001 From: Avni Shyam Date: Fri, 15 Oct 2021 11:53:50 +0530 Subject: [PATCH 6/6] added new pgm --- Python/Program43/{Program43 => Program43.py} | 0 Python/Program44/Program44.py | 0 Python/Program44/Readme.md | 1 + 3 files changed, 1 insertion(+) rename Python/Program43/{Program43 => Program43.py} (100%) create mode 100644 Python/Program44/Program44.py create mode 100644 Python/Program44/Readme.md diff --git a/Python/Program43/Program43 b/Python/Program43/Program43.py similarity index 100% rename from Python/Program43/Program43 rename to Python/Program43/Program43.py diff --git a/Python/Program44/Program44.py b/Python/Program44/Program44.py new file mode 100644 index 00000000..e69de29b diff --git a/Python/Program44/Readme.md b/Python/Program44/Readme.md new file mode 100644 index 00000000..1649e0d0 --- /dev/null +++ b/Python/Program44/Readme.md @@ -0,0 +1 @@ +# Python program to convert decimal into other number systems \ No newline at end of file