Posts

Lower Triangular Matrix In Java ISC

Program to input a 2-D square matrix and check whether it is a Lower Triangular Matrix or not. import java.util.*; class LowerTriangularMatrix {     public static void main()     {         Scanner sc=new Scanner(System.in);         System.out.print("Enter the size of the matrix : ");         int m=sc.nextInt();         int A[][]=new int[m][m];         for(int i=0;i<m;i++)         {             for(int j=0;j<m;j++)             {                 System.out.print("Enter an element : ");                 A[i][j]=sc.nextInt();             }         }         System.out.println("The Matrix is : ");       ...

Multiply Matrices In Java ISC

Program to multiply two given matrices. class Multiplymatrices{ //start of class public void accept(int a[][],int b[][]){ int r1=a.length; int r2=b.length; int c1=a[0].length; int c2=b[0].length; int c[][]=new int[r1][c2]; if(r2==c1){ for(int i=0;i<r1;i++){ for(int j=0;j<c2;j++){ for(int k=0;k<c1;k++){ c[i][j]+=a[i][k]*b[k][j]; }}} System.out.println("the new matrix"); for(int i=0;i<r1;i++){ for(int j=0;j<c2;j++){ System.out.print(c[i][j]+" "); } System.out.println(); } } else { System.out.println("Wrong input"); System.exit(1); }}}//end of class OUTPUT--- Enter the value of r1 then c1 and r2 and c2 2 2 2 2 Enter any number 4 Enter any number 3 Enter any number 4 Enter any number 3 Enter any number 4 Enter any number 3 Enter any number 4 Enter any number 3 2821 2821

Pascal Triangle In Java ISC

-Program to generate a Pascal’s Triangle class PascalTriangle { //start of class public void accept(int n) { int a[][]=new int[n][n]; for(int i=0;i<n;i++){ for(int j=0;j<=i;j++){ if(i==j||j==0) a[i][j]=1; else a[i][j]=a[i-1][j]+a[i-1][j-1]; }} for(int i=0;i<n;i++){ for(int k=1;k<n-1;k++){ System.out.println(" "); } for(int j=0; j<=i;j++){ System.out.print(a[i][j]+" "); } System.out.println(); }}}//end of class OUTPUT--- 1 1 1 1 2 1 1 3 3 1 1 4 6 4 1 

Decimal To Binary In Java ISC & ICSE

Program to convert Decimal to Binary class DecimaltoBinary{//start of class public void accept(int n){ String str=" "; while(n!=0){ int r=n%2; n=n/2; str=Integer.toString(r)+str; } System.out.println("The binary form is "+str); }}//end of class OUTPUT--- WHEN INPUT IS 110 The binary form is 1101110 

Lucky Number In Java ISC

Write a program to generate and print lucky numbers less than a given number N. import java.util.*; class LuckyNumbers {//start of class public void accept(int n) {     int a[]=new int[n];     int c=n;     for(int i=0;i<n;i++){         a[i]=i+1;     } int del=1; System.out.println("Lucky Number Operation :n"); while(del<n) { for(int i=del; i<n; i+=del) { for(int j=i; j<n-1; j++) { a[j]=a[j+1]; } n--; } del++;     for(int i=0;i<n;i++){         System.out.print(a[i]+"");     }     System.out.println();  } //end of while System.out.print("Hence, the Lucky Numbers Less than equal to  " + c + " are : "); for(int i=0; i<n; i++) { System.out.print(a[i]+"   "); } }}//end of class OTPUT--- Hence, the Lucky Numbers Less than equal to  24 are : 1   3   7   13   19

Smith Number In Java ISC

A  Smith number is a composite number, the sum of whose digits is the sum of the digits o     its prime factors obtained as a result of prime factorization. import java.util.*; class Smith { //start of class     public int sumDig(int n)     {         int s1=0;         while(n>0)         {             s1=s1+n%10;             n=n/10;         }         return s1;     }     public int sumPrime(int n)     {         int i=2, s2=0;         while(n>1)         {             if(n%i==0)             {                 s2=s2+sumDig(i);                 n...
ISC 2016 PRACTICAL QUESTIONS SOLVED import java.util.*; class Sort     {         public static void main(String args[])         {             Scanner sc=new Scanner(System.in);             int s=0;             System.out.print("Enter the no. of  rows & columns");             int n=sc.nextInt();             int A[][]=new int[n][n];             for(int i=0;i<n;i++)             {                 for(int j=0;j<n;j++)                 {                     System.out.print("Enter the elements ");                     A[i][j]=sc.n...

A DOCTOR'S JOURNAL ENTRY FOR AUGUST 6,1945(SUMMARY)

   A DOCTOR'S JOURNAL  ENTRY  FOR AUGUST 6,1945(SUMMARY)    Vikram Seth's poem is a dramatic monologue which outlines the impact of the dropping of the atom bomb on the city of Hiroshima,as seen through the eyes of a Japanese doctor that day.Obviously the poem is anti-war and criticises such an inhuman attack that almost destroyed the city and took tens of thosands of lives.War is a inhuman and brutal thing.It results in destruction and suffering.The images created in the poem stir the feelings of the reader.    A rather surprising thing is Vikram Seth's choice of the subject of his poem.This incident occured much before his life time and thousand's of miles away from his homeland(India).But that Seth should have chosen this incident proves that war and its impact is not limited to national boundaries.War is and will always remain a universal disaster.    The speaker is a Japanese doctor who is relaxing in his home on...

ABOUT MYSELF

Hello everyone I am Anik Sarkar from Kolkata (India).I'm in high school now about to graduate next year. I'm an average student having interest in maths and computer.  I am here to share my thoughts and views.I don't understand blogging much but here I am to share my views and thoughts with you.