Skip to content

Instantly share code, notes, and snippets.

@tarunasolanki
tarunasolanki / norm_of_matrix_cpp
Created August 21, 2019 14:28
Program To Find Norm Of Matrix In 2D Array
#include <iostream>
#include <math.h>
using namespace std;
int main()
{ int a[3][3],i , j ,sum ,s ;
cout << "Norm matrix in 2D array " << endl ;
cout << "Enter Array Elements : " << endl ;
// loop for taking input of array elements
@tarunasolanki
tarunasolanki / trace-matrix-2D-array
Created August 21, 2019 13:54
Program To Find Trace Of Matrix In 2D Array In c++
#include <iostream>
using namespace std;
int main()
{
int i , j , sum = 0 , a[3][3] ;
cout << "Trace matrix in 2D array " << endl ;
cout << "Enter Array Elements : " << endl ;
// loop for taking inputs in array
@tarunasolanki
tarunasolanki / linear-search-in-2D-array.c
Created August 20, 2019 15:43
Linear Search In 2D Array
#include <iostream>
using namespace std;
int main()
{ int a[3][3] , n , i ,j ;
cout << "Linear Search in 2D Array" << endl;
cout << "Enter number which you have to find in array :" << endl ;
cin >> n ;
cout << "Enter array elements : " << endl ;
@tarunasolanki
tarunasolanki / transpose_2D_array
Created August 17, 2019 10:03
Program To Transpose Matrix In 2D Array
#include <iostream>
using namespace std;
int main()
{
int i, j;
// input array
int a[3][3];
// transpose array
@tarunasolanki
tarunasolanki / class_and_objects_in_python.py
Created August 9, 2019 14:56
Class And Objects In Python
class Person:
def __init__(self, name, age):
self.name = name
self.age =age
def myfunct(self):
print("Printed by mufunct")
print("Hello !! My name is ",self.name)
print("I am ",self.age," years old.")
@tarunasolanki
tarunasolanki / inverted-left-right-angled-triangle.py
Created August 5, 2019 18:22
Program To Print Inverted-Left-Right-angled-Triangle Star Pattern In Python
#Program to print star pattern
#* * * * * *
#* * * * *
#* * * *
#* * *
#* *
#*
for i in range (0,6):
for j in range (0,6-i):
print("* ",end="")
@tarunasolanki
tarunasolanki / left-right-angled-triangle.py
Created August 5, 2019 17:47
Program To Print Left-Right-angled-Triangle Star Pattern In Python
#Program to print star pattern
#*
#* *
#* * *
#* * * *
#* * * * *
#* * * * * *
for i in range(1,6):
for j in range(1,i+1):
print("*",end=" ")
@tarunasolanki
tarunasolanki / inverted-right-right-angled-triangle.py
Created August 3, 2019 19:38
Program To Print Inverted-Right-angled-Triangle Star Pattern In Python
#Program to print pattern star pattern
# *****
# ****
# ***
# **
# *
n=6
for i in range (1,n):
for j in range (1,i,1):
print(" ",end="")
#Program to print star pyramid pattern
# *
# * *
# * * *
# * * * *
for i in range (1,6):
for j in range(5,i,-1):
print(" ",end="")
for k in range(1,i):
print("* ",end="")
@tarunasolanki
tarunasolanki / Star-Pyramid-Pattern
Created August 3, 2019 17:50
Program To Print Star-Pyramid-Pattern In Python
#Program to print star pyramid pattern
# *
# * *
# * * *
# * * * *
for i in range (1,6):
for j in range(5,i,-1):
print(" ",end="")
for k in range(1,i):
print("* ",end="")