Posts

Showing posts from August, 2021

SUM OF NATURAL NUMBERS

 ************************************************************************  W.A.P TO FIND SUM OF NATURAL NUMBERS ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> // SUM OF NATURAL NUMBERS function sum(nu

FACTORS OF A NUMBER

 ************************************************************************  W.A.P TO FIND THE FACTORS OF A NUMBER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> // fACTOR 12 = 1,2,3,4,6, AND 12 functio

ARMSTRONG NUMBER

 ************************************************************************  W.A.P TO CHECK ARMSTRONG NUMBER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> // ARMSTRONG NUMBER // 153 = 1*1*1 + 5*5*5 + 3

CALCULATOR USING SWITCH

 ************************************************************************  W.A.P TO MAKE A CALCULATOR USING SWITCH CASE ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> function check() {   var n1= docu

FACTORIAL OF A NUMBER

 ************************************************************************  W.A.P TO FIND FACTORIAL OF A NUMBER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> var fact=1; function factr(n){   if(n <

FIND LARGEST NUMBER

************************************************************************  W.A.P TO FIND LARGEST NUMBER AMONG THREE NUMBERS ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> //  Math.max() method function

GENERATE RANDOM NUMBER

  ************************************************************************  W.A.P TO GENERATE A RANDOM NUMBER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <script type="text/javascript"> // Math.random() returns a random floating point number 0 to 1 // Math.random() * (highestNumber - lowestNumber ) + lowestNumber   var x = Math.random(); c

NUMBER SIGN CHECK

************************************************************************  W.A.P TO CHECK NUMBER IS POSITIVE, NEGATIVE OR ZERO ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> function check() {   var va

CELSIUS TO FAHRENHEIT

************************************************************************  W.A.P TO CONVERT CELSIUS TO FAHRENHEIT ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html><head><meta charset="utf-8"><title></title> <script type="text/javascript"> // Fahrenheit = celsius *1.8 +32 functio

KILOMETERS TO MILES

************************************************************************  W.A.P TO CONVERT KILOMETERS TO MILES ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title></title> <script type="text/javascript"> // 1 KM = 0.621371 MILES // MILES = KIL

AREA OF A TRIANGLE

   ************************************************************************  W.A.P TO FIND AREA OF A TRIANGLE ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> // L\ General formula: (base*height)/2 var base = prompt("Enter Base Value: "); var height = prompt("Enter Height Value: "); var area

SQUARE ROOT OF A NUMBER

 ************************************************************************  W.A.P TO FIND A SQUARE ROOT OF A NUMBER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var a = prompt("Enter a number: "); console.log(Math.sqrt(a)); </script> Online Compiler *******************************************

SORT WORDS IN ALPHABETICAL ORDER

  ************************************************************************  W.A.P TO SORT WORDS IN ALPHABETICAL ORDER ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Enter a string: "); var stringArray = string.split(' '); stringArray.sort(); console.log(stringArray.join(&

REPLACE CHARACTERS OF A STRING

 ************************************************************************  W.A.P TO REPLACE CHARACTERS OF A STRING ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> // var string = prompt("Enter a string: "); var string = "Mr. Red has a red cap and a red book"; var reg =new RegExp('red'

FIRST LETTER OF A STRING IN TO UPPERCASE

   ************************************************************************  W.A.P TO CONVERT THE FIRST LETTER OF A STRING IN TO UPPERCASE ************************************************************************   JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Enter a string: "); var first = string.charAt(0); var rem = string.slice(1); var caps = first.

NUMBER OF OCCURRENCES OF A CHARACTER IN A STRING

 ************************************************************************  W.A.P TO CHECK THE NUMBER OF OCCURRENCES OF A CHARACTER IN A STRING ************************************************************************   REGEX MEANS REGULAR EXPRESSION JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Enter a string: "); var letter = prompt("Enter a lette

COUNT THE NUMBER OF VOWELS IN A STRING USING REGEX

************************************************************************  W.A.P TO COUNT THE NUMBER OF VOWELS IN A STRING USING REGEX ************************************************************************   REGEX MEANS REGULAR EXPRESSION JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Enter a string: "); const reg = /[aeiou]/gi; var chars = string.matc

STRING STARTS AND ENDS WITH CERTAIN CHARACTERS

  ************************************************************************  W.A.P TO CHECK WEATHER A STRING STARTS AND ENDS WITH CERTAIN CHARACTERS ************************************************************************  JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a server side scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Please enter a string: "); var substring = "the"; var testStart= string.star

STRING CONTAINS A SUBSTRING

  ************************************************************************  W.A.P TO CHECK WEATHER A STRING CONTAINS A SUBSTRING OR NOT ************************************************************************  JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a serverside scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Please enter a string: "); var substring = "the"; var test1= string.includes(substring);

PALINDROME STRING

    ************************************************************************  W.A.P TO CHECK GIVEN STRING IS PALINDROME STRING OR NOT ************************************************************************  JAVA Program           Online compiler Output: ************************************************************************  C Program Online Compiler     ************************************************************************  C++ Program Online Compiler ************************************************************************  C# Program   Online Compiler   Output: ************************************************************************  PHP Program Online Compiler Php is a serverside scripting language. ************************************************************************  JAVASCRIPT Program  <script type="text/javascript"> var string = prompt("Please enter a string: "); var stringArray = string.split(''); var stringArrayRev = stringArr

PRIME NUMBER

    ************************************************************************  W.A.P TO GENERATE A LIST OF PRIME NUMBERS ************************************************************************  JAVA Program import java.util.Scanner; class Prime{     Scanner sc= new Scanner(System.in);     public void p1ton()     {         int i=0;         int num=0;         System.out.println("\nEnter upper limit: ");         int ul=sc.nextInt();         String primeNumbers ="";         for( i=1; i<=ul; i++){             int counter=0;             for (num=i; num>=1; num--){             if(i%num==0)             {                 counter = counter +1 ;             }             }             if (counter == 2)             {                 primeNumbers = primeNumbers + i + " ";             }         }         System.out.println("\nPrime numbers from 1 to 100 are :\n");         System.out.println(primeNumbers);     }          public void usern()     {        

PALINDROME NUMBER

  ************************************************************************  W.A.P TO CHECK GIVEN NUMBER IS PALINDROME NUMBER OR NOT ************************************************************************  JAVA Program import java.util.Scanner; class demo {     public static void main(String[] args) {         Scanner sc=new Scanner(System.in);         System.out.println("Enter the Number: " );         int n= sc.nextInt();         // System.out.println("\nEntered number is: "+n);         int temp=0,x;         int n2= n;         while (n>0){             x=n%10;             n=n/10;             temp= temp*10+x;         }         if (temp == n2)         {             System.out.println("Number is Panildrome " );         }         else{             System.out.println("Number is not Panildrome " );         }          }}                         Online compiler Output: Enter any Number : 161 Number is Palindrome *****************************