Skip to content
Merged
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
1 change: 1 addition & 0 deletions C++/Program 28/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
program for linear search using menu driven program
89 changes: 89 additions & 0 deletions C++/Program 28/menu driven linear search.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
#include<iostream>
using namespace std;
#define R 3
#define C 3
int enter(int arr[R][C], int r, int c)
{

for(int i=0; i<r; i++)
{
for(int j=0; j<c; j++)
{
cout<<"enter the data ";
cin>>arr[i][j];
}
}
}
int display(int arr[R][C], int r, int c)
{
cout<<".................the matrix is ................"<<endl;
for(int i=0; i<r; i++)
{
for(int j=0; j<c; j++)
{
cout<<arr[i][j]<<"\t";
}
cout<<endl;
}
}
int search(int arr[R][C], int r, int c)
{
int item,flag=0;
cout<<"enter the item to be serached :";
cin>>item;

for(int i=0; i<r; i++)
{
for(int j=0; j<c; j++)
{
if(item==arr[i][j])
flag=1;
}
}
if(flag==1)
{
cout<<"item found";
}
else
cout<<"item not found";
}
int main()
{
int arr[R][C];
cout<<"press 1 for entering the matrix"<<endl;
cout<<"press 2 for dispalaying the matrix"<<endl;
cout<<"press 3 for linear search"<<endl;
int ch;
do
{ cout<<"enter the choice "<<endl;
cin>>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;
}




2 changes: 1 addition & 1 deletion C/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

<hr>

49 changes: 49 additions & 0 deletions C/program-83/program-83.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
#include<stdio.h>
#include<stdlib.h>
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<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&a[i][j]);
}
}
printf("enter the second matrix element=\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
scanf("%d",&b[i][j]);
}
}

printf("multiply of the matrix=\n");
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
mul[i][j]=0;
for(k=0;k<c;k++)
{
mul[i][j]+=a[i][k]*b[k][j];
}
}
}
//for printing result
for(i=0;i<r;i++)
{
for(j=0;j<c;j++)
{
printf("%d\t",mul[i][j]);
}
printf("\n");
}
return 0;
}
1 change: 1 addition & 0 deletions C/program-83/readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Program to multiply two matrices
Empty file added Python/Program43/Program43.py
Empty file.
1 change: 1 addition & 0 deletions Python/Program43/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Display the powers of 2 using anonymous function
Empty file added Python/Program44/Program44.py
Empty file.
1 change: 1 addition & 0 deletions Python/Program44/Readme.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Python program to convert decimal into other number systems
1 change: 1 addition & 0 deletions kotlin/Program3/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Write a program to filter number from list in kotlin
19 changes: 19 additions & 0 deletions kotlin/Program3/filterList.kt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
fun main(args: Array<String>) {
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")
}
3 changes: 2 additions & 1 deletion kotlin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

</div>