Skip to main content

Posts

Showing posts from November, 2021

Recurssion function

Recusrion function: 1. Follow the stack  2. Height of stack is almost equal to height of n // in the given code The cycle to call function. 1.Main to call function 2.Base 3.Work Like ex. public class Recursion{ public static int cal(int x, int n) { // Code execute when filling of stack  // First base 1 If(n==0){ return 1; } //Second base 2  If(x==0){ return 0; } // Work //calling function recursion int xpm= cal(x, n-1); // The code is executing below this when in deleting the level of stack  int xpn= x* xpm; return xpn } //Main to call the function first time public static void main(String args[]){ int x=2, n= 5; System.out.println(cal(x,5)); } }

Ninth day for full stack development -->> Java Script: String, Primitive type, variable

JavaScript Begining  clear{}--> to clear the console Console Type :-  REPL --> Read Evaluate Print Loop Primitive type  1. Number :-  math operation Format to do math operation. :- PEMDAS -> parenthesis, exponents, multi, division, addition, subtraction. use Mod % for Remender if Zero than even and if 1 then odd, divide by2. and two use exponent uses two-star(**) use( typeof), to get which type o primitive type. 2. variable:- .let .Const> the values can not change, We store value does not change in your app, this does not work on array and object. .var--> Variable naming. can use _ use lower case not use no. 3. String :-  can define in double quotes("") or single quotes ('') use index in string :- var_name[0]; get index length :- var_name.length; can add to string :- "lol"+"lol"; Plus sign(+) is concatination. using method :- thing.method() ; using property:- thing.properties; Diff Strings Methods:- Strings.trim() --> trim spaces,...