diff --git a/vijay bissa/11 may/q1.png b/vijay bissa/11 may/q1.png new file mode 100644 index 0000000..01d547d Binary files /dev/null and b/vijay bissa/11 may/q1.png differ diff --git a/vijay bissa/11 may/q1.py b/vijay bissa/11 may/q1.py new file mode 100644 index 0000000..812ccff --- /dev/null +++ b/vijay bissa/11 may/q1.py @@ -0,0 +1,13 @@ +def findSingle( ar, n): + + res = ar[0] + + for i in range(1,n): + res = res ^ ar[i] + + return res + + +print("Enter The Numbers:- ") +ar= list(map(int,input().split())) +print ("Element occuring once is", findSingle(ar, len(ar))) diff --git a/vijay bissa/11 may/q4..png b/vijay bissa/11 may/q4..png new file mode 100644 index 0000000..bb7573c Binary files /dev/null and b/vijay bissa/11 may/q4..png differ diff --git a/vijay bissa/11 may/q4.py b/vijay bissa/11 may/q4.py new file mode 100644 index 0000000..2e22ea6 --- /dev/null +++ b/vijay bissa/11 may/q4.py @@ -0,0 +1,10 @@ +A=int(input("Enter the size of Grid:- ")) +if A<0: + print(1) +else: + arr=[0 for i in range(A+2)] + arr[0]=arr[1]=1 + for i in range(2,A+1): + for j in range(i+1): + arr[i]=(arr[i]+arr[j]*arr[i-j-1])%(10**9+7) + print(arr[A-1]) \ No newline at end of file diff --git a/vijay bissa/11 may/q5.png b/vijay bissa/11 may/q5.png new file mode 100644 index 0000000..880635c Binary files /dev/null and b/vijay bissa/11 may/q5.png differ diff --git a/vijay bissa/11 may/q5.py b/vijay bissa/11 may/q5.py new file mode 100644 index 0000000..356c22a --- /dev/null +++ b/vijay bissa/11 may/q5.py @@ -0,0 +1,18 @@ +num=int(input("Enter the number to find Square Root:-")) +f=0 +if(num==0 or num==1): + print(num) +st=1 +end=num +while(st<=end): + mid=(st+end)//2 + if(mid**2==num): + print(mid) + f=1 + if(mid**2 +using namespace std; +bool prime(int n) +{ + int f=0; + for(int i=2;i<=(n/2);i++) + { + if(n%i==0) + { + f=1; + break; + } + } + if(f==1) + { + return false; + } + else + { + return true; + } +} + + +int main() +{ + int r,c,count=0,i,j; + cout<<"\nEnter number of rows : "; + cin>>r; + cout<<"\nEnter number of columns : "; + cin>>c; + int arr[r][c]; + for(i=0;i>arr[i][j]; + } + } + for(i=0;i=0) + { + sum += arr[i-1][j]; + } + if(j+1=0) + { + sum += arr[i][j-1]; + } + if(prime(sum)) + { + count++; + } + + } + } + cout<<"Result = "< +using namespace std; +int main() +{ + int r,count=0,i,j; + cout<<"\nEnter size of nxn matrix : "; + cin>>r; + int arr[r][r]; + for(i=0;i>arr[i][j]; + } + } + int n; + cout<<"Enter number for search : "; + cin>>n; + i=0; + j=0; + int f=0; + while(i +using namespace std; +bool odd(int n) +{ + if (n%2==0) + { + return false; + } + else + { + return true; + } +} +int main() +{ + int r,c,count=0,i,j; + cout<<"\nEnter number of rows : "; + cin>>r; + cout<<"\nEnter number of columns : "; + cin>>c; + int arr[r][c]; + for(i=0;i>arr[i][j]; + } + } + for(i=0;i