Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Matrix-Multi #19

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
29 changes: 29 additions & 0 deletions C/Matrix-Multi.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
#include <stdio.h>

int main()
{
int a[3][3],b[3][3],c[3][3],i,j,k;

for (i=0;i<3;i++)
{ for (j=0;j<3;j++)
scanf("%d",&a[i][j]);
}
for (i=0;i<3;i++)
{ for (j=0;j<3;j++)
scanf("%d",&b[i][j]);
}

for (i=0;i<3;i++)
{ for (j=0;j<3;j++)
{c[i][j]=0;
for (k=0;k<3;k++)
{
c[i][j]+=a[i][k]*b[k][j];
}}}
for (i=0;i<3;i++)
{ for (j=0;j<3;j++)
{ printf("\t%d",c[i][j]);
}
printf("\n");}
return 0;
}
29 changes: 29 additions & 0 deletions python/split-join-string.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Python program to split a string and
# join it using different delimiter

def split_string(string):

# Split the string based on space delimiter
list_string = string.split(' ')

return list_string

def join_string(list_string):

# Join the string based on '-' delimiter
string = '-'.join(list_string)

return string

# Driver Function
if __name__ == '__main__':
string = 'Rahul Goyal'

# Splitting a string
list_string = split_string(string)
print(list_string)

# Join list of strings into one
new_string = join_string(list_string)
print(new_string)