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; +} + + + + diff --git a/C/README.md b/C/README.md index 72058de2..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-83/program-83.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) { + 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