Posts

Showing posts from August, 2021

Calculate Compound Interest in JavaScript

Image
 Calculate Compound Interest in JavaScript HTML CODE <!DOCTYPE   html > <html   lang = "en" > <head>      <meta   charset = "UTF-8" >      <meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      <meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      <title> Document </title> </head> <body>      <table>          <tr>              <td> Enter Principle </td>              <td>                  <input   type = "text"   name = ""   id = "p" >   ...

HCF LCM Finder in JavaScript

Image
 HCF LCM Finder in JavaScript HTML CODE <!DOCTYPE   html > <html   lang = "en" > <head>      <meta   charset = "UTF-8" >      <meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      <meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      <title> Document </title> </head> <body>      <table>          <tr>              <td> Enter 1st Number </td>              <td>                  <input   type = "text"   id = "n1" >       ...

Make a GST Calculator using HTML and JavaScript

Image
 Make a GST Calculator using HTML and JavaScript  HTML <!DOCTYPE   html > <html   lang = "en" > <head>      <meta   charset = "UTF-8" >      <meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      <meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      <title> Document </title> </head> <body>      <table>          <tr>              <td> Product Name </td>              <td>                  <input   type = "text"   id = "pn" >     ...

Enter mark of subject and display total and average using array in java

Image
 Enter mark of subject and display total and average using array in java import  java.util.*; public   class   Arr {      public   static   void   main ( String   args []){          Scanner   input  =  new   Scanner ( System . in );         String   sub []={ "Hindi" , "Math" , "Eng" , "SST" , "GSE" };         int   mark []= new   int [ 5 ];         int   total = 0 ;         double   avg ;         System . out . println ( "Enter Mark :" );         for ( int   i = 0 ;i< mark . length ;i++){          System . out . print ( "Enter the mark of " +sub[i]);  ...

Write a program to find minimun digit of a number in java

Image
  Write a program to find minimum digit of a number in java public   class   MinDigit {      public   static   void   main ( String   args []){      int   num = 1234 ,min , last , temp;     temp=num;      min=num% 10 ;       while (temp!= 0 ){          last=temp% 10 ;          if  (min>last){          min=last;         }         temp=temp/ 10 ;     }           System . out . println (num+ " min number is "  +min);     } } Output 1234 min number is 1

Tooltips using by HTML and CSS

Image
 Tooltips using by HTML and CSS HTML CODE <!DOCTYPE   html > <html   lang = "en" > <head>      <meta   charset = "UTF-8" >      <meta   http-equiv = "X-UA-Compatible"   content = "IE=edge" >      <meta   name = "viewport"   content = "width=device-width, initial-scale=1.0" >      <title> Document </title>      <link   rel = "stylesheet"   href = "style.css" > </head> <body>      <h1> Tooltips Using by HTML CSS JS </h1>      <div   class = "tooltip" >         Mouse Over to view tooltip          <span   class = "tooltip-text" > Hi I am Toop Tips </span...

Write a program to find the sum of 1/2+4/3+5/6+8/7+9/10 using loop in java

Image
  Write a program to find the sum of 1/2+4/3+5/6+8/7+9/10 using loop in java public   class   SumOfSeries {     public   static   void   main ( String   args []){         double   a = 1 ,b= 2 ,sum= 0 ;      for ( double   i = 1 ;i<= 5 ;i++){          if (i% 2 != 0 ){           System . out . print (a+ "/" +b+ " + " );             sum+=a/b;             a=a+ 2 ;             b=b+ 2 ;         } else {                    System . out . print (b+ "/" +a+ " + " );  ...

Write a program to accept a word and pass this word to a function name void display(String str). Display all the vowels present in the word in java.

 Write a program to accept a word and pass this word to a function name void display(String str). Display all the vowels present in the word in java. public   class   ReturnVowel {    static   void   display ( String   str ){      String   s  =  str . toLowerCase ();      for ( int   i = 0 ;i< s . length ();i++){          if ( s . charAt (i)== 'a' || s . charAt (i)== 'e' || s . charAt (i)== 'i' || s . charAt (i)== 'o' || s . charAt (i)== 'u' ){          System . out . println ( str . charAt (i));         }     }     }    public   static   void   main ( String   args []){      String   name  =  "cOmputer" ;      display (name);    ...

Write a program to find the sum of 1/2 - 2/3 + 3/4 - 4/5 +5/6 in java

 Write a program to find the sum of 1/2 - 2/3 + 3/4 - 4/5 +5/6 in java public   class   SumOfSeries {       public   static   void   main ( String   args []){          double   sum = 0 ;          int   i , N = 5 ;          for (i = 1 ;i<=N;i++){              if (i% 2 != 0 ){              System . out . print (i+ " / " +(i+ 1 )+ " - " );             sum +=( double )i/(i+ 1 );                                    } else {  ...

Create a program to demonstrate the use of Arithmetic Operators in java

 Create a program to demonstrate the use of Arithmetic Operators in java public   class   ArithemeticOperators {      public   static   void   main ( String   args []){      int   a  =  20  , b =  10 ;  //Variables are declared and initialized      int   result ;     result = a+b;      System . out . println (result);  //Result affter addition will be displayed as 30     result = a-b;      System . out . println (result);  //After subtraction the result will be displayed as 10     result = a*b;      System . out . println (result);  //After multiplication the result will...

Create a program to demonstrate the use of Unary Operators in java

 Create a program to demonstrate the use of Unary Operators in java public   class   UnaryOperater {     public   static   void   main ( String   args []){      int   a = 20 ,result;     result=+a;      System . out . println (result);  //Result is still 20     result=-a;      System . out . println (result);  //Result is now -20     result=++a;      System . out . println (result);  //Result is now 21     result=--a;      System . out . println (result);  //Result is now 20     result=a++;      System . out . println (result);  //Result is now 20     result=a--;      System . ou...

Create a program to demonstrate the use of the Conditional Operator in java

 Create a program to demonstrate the use of the Conditional Operator in java public   class   TernaryOperator {      public   static   void   main ( String   args []){      int   a = 3 ;      int   b = 10 ;      int   c ;     c=a>b ? (a-b) : (b-a);      System . out . println (c);     } } Output 7

Write a program to check a number is Peterson number or not in java

Image
  Write a program to check a number is Peterson number or not in java public   class   Peterson {     public   static   void   main ( String   args []){       int   num = 145 ,temp,last,fact,sum= 0 ;      temp=num;             while (temp!= 0 ){          last=temp% 10 ;          fact= 1 ;           for ( int   i = 1 ;i<=last;i++){             fact *= i;             }         sum+=fact;         temp=temp/ 10 ;         }      ...

Write a program to check a number is neon or not in java

 Write a program to check a number is neon or not in java public   class   Neon {     public   static   void   main (){         int   num = 9 ,temp,square,sum= 0 ;                temp=num*num;         while (temp!= 0 ){         sum += temp% 10 ;         temp=temp/ 10 ;         }                   if (sum==num){          System . out . println ( "Neon Number" );         } else {          System . out . println ( "Not a Neon Number" );    ...

Create a temperature converter in java

 Create a temperature converter in java import  java.util.Scanner; public   class   TempertureConverter {      public   static   void   main (){      double   celsius , fahrenheit , kelvin ;      int   option ;      Scanner   input  =  new   Scanner ( System . in );      System . out . println ( "Press 1 celsius to fahrenheit" );      System . out . println ( "Press 2 fahrenheit to celsius" );      System . out . println ( "Press 3 celsius to kelvin" );      System . out . println ( "Press 4 kelvin to celsius" );      System . out . println ( "Press 5 fahrenheit to kelvin" );      System . out . println ( "Press 6 kelv...