Posts

Showing posts from November, 2020

Data type and its memory size( java)

Image
 

program to calculate perimeter of rectangle

  class perimeter { public static void main(String args[]) {  int peri, length, breadth;  length=10; breadth=29; peri=2*(breadth+length); System.out.println(peri); }}

programe to calculate area of rectangle

 class area { public static void main(String args[]) {  int area, length, breadth;  length=10; breadth=29; area=breadth*  length; System.out.println(area); }}

How to insert page border in ms-word

Image
 click page layout tab-> click page border-> choose one border ->  if you want change the design or colour-> ok

How to insert shapes in ms-word

Image
 Click insert tab-> click shapes-> choose one shape -> drag

What is smart art? How to insert Smart art

Image
 Q- What is Smart art? Ans-  A  SmartArt  graphic is a visual representation of your information and ideas. Q- How to insert smart art. Ans- Click the insert tab-> click the smart art-> chose one smart art-> ok

How to insert word art

Image
 Q- What is word art? Ans- Special effects in Microsoft  Word  that change the appearance of text. Q- How to insert Word art Ans- click insert tab-> word art-> choose one design-> write your text -> ok

How to insert Header and Footer

Image
Q. What is header and footer?   A  header  is the top margin of each page, and a  footer  is the bottom margin of each page.  Headers and footers  are useful for including material that you want to appear on every page of a document such as your name, the title of the document, or page numbers. Q- How to insert Header and Footer Ans- click insert tab-> header or footer-> then insert

How to give hyper link from one document to another

Image
  Select the text or object you want to use as a  hyperlink . Right-click and then click  Hyperlink  . Under  Link  to, click Place in This Document. In the list, select the heading or bookmark that you want to  link  to            or   select the text ->click inset tab-> click hyperlink-> one window will  open-> then chose the file -> ok

change font style in msword

Image
  Select the  text  that you want to  change . · On the Home tab, in the  Font  group, choose the arrow next to  Font style , and then select a font.

how to change the font size and color in ms-word

Image
// change font color Select the  text  that you want to  change . · On the Home tab, in the  Font  group, choose the arrow next to  Font Color , and then select a  color .  // change font size Select the  text  that you want to  change . · On the Home tab, in the  Font  group, choose the arrow next to  Font Size , and then select a size . 

how to insert table in ms-word

Image
 click insert tab-> table -> choose one table style

how to insert clip art in ms-word

Image
  click the insert tab->clip art-> (right side of window clip art option appear)->click go option-> choose one clip art->double click on it

how to save file in ms-word

Image
open ms-word ->save option ->(one window will open)->write the file name ->save To use the Save As/save command: Click the  Microsoft Office button . Select  Save As/save Word Document . The  Save As  dialog box appears. Select the  location  where you want to save the document using the drop-down menu. Enter a  name  for the document. Click the  Save  button.

method related topic in java

Image
 

Array

Image
 

keyboard short cut key

Image
 

series-11

1 0 1 1 0 1 0 1 0 1   class series { public static void main(String args[]) { for(int r=1;r<=4;r++) { for (int c=1 ; c<=r ; c++) { if((r+c)%2==0) System.out.print(1+ "  "); else System.out.print(0+"  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int d=1; // how many element in first line for(int r=1;r<=4;r++) { for (int c=1 ; c<=d ; c++) { if((r+c)%2==0) System.out.print(1+ "  "); else System.out.print(0+"  "); } d++; System.out.println() // to come to next line } } }

series-10

1 1 0 1 0 1 1 0 1 0   class series { public static void main(String args[]) { for(int r=1;r<=4;r++) { for (int c=1 ; c<=r ; c++) { if(c%2==0) System.out.print(0+ "  "); else System.out.print(1+" "); } System.out.println() // to come to next line } } } //Common way class series { public static void main(String args[]) { int d=1;  // how many element in first line for(int r=1;r<=4;r++) { for (int c=1 ; c<=d ; c++) { if(c%2==0) System.out.print(0+ "  "); else System.out.print(1+" "); } d++; System.out.println() // to come to next line } } }

series-9

 *  * * * * * * * * * class series { public static void main(String args[]) { for(int r=1;r<=4;r++) { for (int c=1 ; c<=r ; c++) { System.out.print("*"+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int  d=1;   //    d- means how many element in first line for(int r=1;r<=4;r++) { for (int c=1 ; c<=d ; c++) { System.out.print('*'+ "  "); } d++; System.out.println() // to come to next line } } }

series-8

 1 2 3 4 5 1 2 3 4 1 1 2 3 1 2 1 2 1 2 3 class series { public static void main(String args[]) { int a,d=5; for(int r=1;r<=5;r++) { a=1; for (int c=1 ; c<=5 ; c++) { if(c<=d) System.out.print(c); else System.out.print(a++) } d--; System.out.println() // to come to next line } } }

series-7

 1 2 3 4 5  2 2 3 4 5 3 3 3 4 5 4 4 4 4 5 class series { public static void main(String args[]) { for(int r=1; r<=4; r++) { for (int c=1 ; c<=5 ; c++) { if(c<=r) System.out.print(r); else System.out.print(c); } System.out.println() // to come to next line } } }

series-6

 1 2 3 4 5 6 class series { public static void main(String args[]) { int a=1; for(int r=1 ; r<=3 ; r++) { for (int c=1 ; c<=r ; c++) { System.out.print(a+ "  "); a++; } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=1;   //  a- means first value  d- means how many element in first line for(int r=1;r<=4;r++) { for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a++; } d++; System.out.println() // to come to next line } } }

series-5

1 2 3 4 5 2 3 4 5 3 4 5 4 5 5 class series { public static void main(String args[]) { for(int r=5 ; r>=1 ; r--) { for (int c=r ; c<=5 ; c++) { System.out.print(c+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=5;   //  a- means first value  d- means how many element in first line for(int r=1;r<=4;r++) { a=r; for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a++; } d--; System.out.println() // to come to next line } } }

series-4

1 1 1 1 2 2 2 2 3 3 3 3   class series { public static void main(String args[]) { for(int r=1;r<=3;r++) { for (int c=1 ; c<=4 ; c++) { System.out.print(r+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=4;   //  a- means first value  d- means how many element in first line for(int r=1;r<=3;r++) { for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); } a++; System.out.println() // to come to next line } } }

series-3

1 2 3 4 1 2 3 4 1 2 3 4   class series { public static void main(String args[]) { for(int r=1;r<=3;r++) { for (int c=1 ; c<=4 ; c++) { System.out.print(c+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=4;   //  a- means first value  d- means how many element in first line for(int r=1;r<=4;r++) { a=1; for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a++; } System.out.println() // to come to next line } } }

series-2

 5 4 3 2 1 5 4 3 2 5 4 3 5 4 5 // shortcut way class series { public static void main(String args[]) { for(int r=1;r<=5;r++)  //  r- for row { for (int c=5 ; c>=r ; c--)// c- column { System.out.print(c+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=5, d=5;   //  a- means first value  d- means how many element in first line for(int r=1;r<=5;r++) { a=5; for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a--; } d--; System.out.println() // to come to next line } } }

series-1

 1 1 2 1 2 3 1 2 3 4 //short cut way class series { public static void main(String args[]) { for(int r=1;r<=4;r++) { for (int c=1 ; c<=r ; c++) { System.out.print(c+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=1;   //  a- means first value  d- means how many element in first line for(int r=1;r<=4;r++) {   a=1; for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a++; } d++; System.out.println() // to come to next line } } }

series program

 1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 class series { public static void main(String args[]) { for(int r=5 ; r>=1 ; r--) { for (int c=1 ; c<=r ; c++) { System.out.print(c+ "  "); } System.out.println() // to come to next line } } } // common way class series { public static void main(String args[]) { int a=1, d=5;   //  a- means first value  d- means how many element in first line for(int r=1;r<=4;r++) {   a=1; for (int c=1 ; c<=d ; c++) { System.out.print(a+ "  "); a++; } d++; System.out.println() // to come to next line } } }

program to convert binary to decimal(using java)

  class binary_decimal { public static void main(String args[]) { int  no=1101,b=0,sum=0,i=0; while(no>0) { b=n0%10; no=no/10; sum=sum+(int) b* Math.pow(2,i++); } System.out.println(sum); } }

check the number is binary or not(using java)

 // a number is said to binary if all the digit should be either zero or one ex-1011  binary number    ex-1201 not binary number class binary { public static void main(String args[]) { int  no=125,b=0,e=0; while(no>0) { b=n0%10; no=no/10; if(b>1) { e=1; break; } } if(e==0) System.out.println("the number is binary"); else System.out.println("the number is not binary"); } }

program to caluclate automerphic number(using java)

// if a number is present at the end of its square ex- 25   sqr=625  (25 is present at the end of 625)  class automerphic { public static void main(String args[]) { int  no=125, sqr=0,b=0,c=0,e=0; sqr=no* no; while(no>0 && sqr>0) { b=n0%10; no=no/10; c=sqr%10; sqr=sqr/10; if( b !=c) { e=1;     // e is the marking symbol break; }} if(e==0) System.out.println("automerphic"); else System.out.println("not auto merphic"); } }

program to find smallest digit of a number(using java)

  class smallest  { public static void main(String args[]) { int  no=125, small=9,b=0; while(no>0) { b=n0%10; no=no/10; if(b<small) small=b; } System.out.println(small); } }

program to find greatest digit of a number(using java)

  // a=125  ans-5 class greatest { public static void main(String args[]) { int  no=125, great=0,b=0; while(no>0) { b=n0%10; no=no/10; if(b>great) great=b; } System.out.println(great); } }

programe to add all the digit of a number (using java)

  // ex-125  ans-1+2+5=8 class add_digit { public static void main(String args[]) { int  no=125, sum=0,b=0; while(no>0) { b=n0%10; no=no/10; sum=sum+b; } System.out.println(sum); } }

check the number is Amstrong (using java)

// if the addition of cube of all the digit of a number is same as original number  ex- 153  1^3+5^3+3^3=153   class amstrong { public static void main(String args[]) { int  no=125, sum=0,copy=0,b=0; while(no>0) { b=n0%10; no=no/10; sum=sum+b * b * b; } if(copy= =sum) System.out.println("amstrong number"); else System.out.println("not amstrong"); } }

check the number is palin drome(using java)

  // if the reverse of a number is same as original number then the number is palindrome // ex- a=121  ans -121     a=125 ans -521 is not palindrome class palindrome { public static void main(String args[]) { int  no=125, rev=0,b=0 copy=no; while(no>0) { b=n0%10; no=no/10; rev=rev *10+b; } if(copy==rev) System.out.println("palindrome"); else System.out.println("not palindrome"); } }

print reverse of a number(using java)

// a=125  ans-521;   class reverse { public static void main(String args[]) { int  no=125, rev=0,b=0; while(no>0) { b=n0%10; no=no/10; rev=rev *10+b; } System.out.println(rev); } }

calculate LCM of two number (using java)

  class lcm { public static void main(String args[]) { int a=10,b=4,LCM=0; for(int i=Math.max(a,b); i<=a*b ; i++) { if(i%a==0 && i%b==0) { LCM=i break; }} System.out.println(LCM); }}

calculate HCF

  class hcf { public static void main(String args[]) { int  a=10,b=12,HCF=0; for(int i=1; i<=Math.min(a,b) ; i++) { if(a%i==0 && b%i==0) HCF=i } System.out.println(HCF); }}

find fibonic series (using java)

// fibonic number 0,1,1,2,3,5..   class fibonic { public static void main(String args[]) { int a=0,b=1,sum=0; System.out.println(a); System.out.println(b); for(int i=1; i<=n ; i++) { sum=a+b; a=b; b=sum; System.out.println(sum); } }}

Calculate factorial of a number(using java)

 // factorial of a number 5!=  5*4*3*2*1      =120 class factorial { public static void main(String args[]) { int no=10,fact=1; for(int i=1; i<=no ; i++) { fact=fact*i; } System.out.println(fact); }}

check the number is perfect (using java)

 //if the addition of factors of a number except that number is same as original number then the number is perfect ex n0=6  factor 1,2,3  that means 1+2+3=6  then it is perfect number class perfect { public static void main(String args[]) { int no=10,sum=0; for(int i=1; i<no ; i++) { if(no%i==0)  // i is the factor of that number { sum=sum+i } } if(sum==no) System.out.println("perfect number"); else System.out.println("not"); }}

check the number is prime (using java)

 class prime { public static void main(String args[]) { int no=10,count=0; for(int i=1; i<=no ; i++) { if(no%i==0)  // i is the factor of that number { count++; } } if(count==2) System.out.println("prime no"); else System.out.println("composite no"); }}