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

sum of 2 #111

Open
wants to merge 4 commits into
base: main
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
20 changes: 20 additions & 0 deletions coding_freshmen/JAVA/Subhrajit/Anagram.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import java.util.*;
public class anagram
{public void main()
{Scanner sc = new Scanner(System.in);
String t,s;
int i,j,c=0;
System.out.println("Enter a String");
s=sc.next();
System.out.println("Enter another String");
t=sc.next();
for(i=0;i<t.length();i++)
for(j=i;j<t.length();j++)
if(t.charAt(j)==s.charAt(i))
c++;
if(c==s.length()||c>s.length())
System.out.println("True");
else
System.out.println("False");
}
}
29 changes: 29 additions & 0 deletions coding_freshmen/JAVA/Subhrajit/merge.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import java.util.*;
public class merge
{public void main(String args[])
{int n,i,j;
Scanner sc = new Scanner(System.in);
System.out.println("Enter number of row of array");
n=sc.nextInt();
int a[][]=new int[n][n];
int b[][]=new int[n][n];
int c[][]=new int[n][n];
System.out.println("Enter elements of first array");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
a[i][j]=sc.nextInt();
System.out.println("Enter elements of second array");
for(i=0;i<n;i++)
for(j=0;j<n;j++)
b[i][j]=sc.nextInt();
for(i=0;i<n;i++)
for(j=0;j<n;j++)
c[i][j]=a[i][j]+b[i][j];
System.out.println("\nAnswer");
for(i=0;i<n;i++)
{for(j=0;j<n;j++)
System.out.print(c[i][j]+" ");
System.out.println();
}
}
}