Modulus Operator JavaScript

Program to use ( % ) Modulus Operator JavaScript Language


let a = 5;
let b = 2;
let c;
c = a % b;
console.log('c = ', c);

Output


c = 1

Steps Description

  1. Declare three variables a, b and c
  2. Initialize both variables with value of 5 and 2 respectively a=5, b=2
  3. Assign c variable with Assignment Operators (=) with the remainder/percentage value of variables a and b
  4. a, b variables की value को (%) Modulus Operators ki सहयता से a%b numbers को remainder/percentage किया गया हैं
  5. console.log inbuilt function की मदद्द से c variable की value को display किया गया हैं

Simple Arrow Function Using JavaScript

Simple Arrow Function Number


let ArrowFunction = (a, b) => 5 * 7;
// Created a variable arrowFunction and initialized a ,b  
// in it and passing the parameters to the arrowfunction 

console.log(ArrowFunction());

Output


35

Simple Arrow Function String


let ArrowFunction = () => "Hello World";
// Created a variable arroFunction and did not initialize any value
// in it and the parameter is being passed to the arrowfunction

console.log(ArrowFunction());

Output


Hello World

Simple Arrow Function Length


let country = ["India", "Bangladesh", "Srilanka", "China"];
//Defined variable country and initialize array string value

console.log(country.map((country) => country.length));
//Defined variable country and passed some string values in it array
//called all strings via string.map
//Shows the length of all index values count word

Output


[ 5, 10, 8, 5 ]

Division Operator JavaScript

Program to use Division Operator JavaScript Language


let x = 15;
let y = 3;
let z;
z = x / y;
console.log("z = ", z);

Output


z = 5

Steps Description

  1. Declare three variables x, y and z
  2. Initialize both variables with value of 15 and 3 respectively x=15, y=3
  3. Assign z variable with Assignment Operators (=) with the divides/भाग value of variables x and y
  4. x, y variables की value को (/) Division Operators ki सहयता से x/y numbers को divides/भाग किया गया हैं
  5. console.log inbuilt function की मदद्द से z variable की value को display किया गया हैं

Multiplication Operator JavaScript

Program to use Multiplication Operator JavaScript Language


let a = 5;
let b = 3;
let c;
c = a * b;
console.log("c = ", c);

Output


c = 15

Steps Description

  1. Declare three variables a, b and c
  2. Initialize both variables with value of 5 and 3 respectively a=5, b=3
  3. Assign c variable with Assignment Operators (=) with the multiplie/गुड़ा value of variables a and b
  4. a, b variables की value को (*) Multiplication Operators ki सहयता से a*b numbers को multiplie/गुड़ा किया गया हैं
  5. console.log inbuilt function की मदद्द से c variable की value को display किया गया हैं

How to use bigger number control statements in c language

program to use bigger number control statements in c language


#include<stdio.h>
int main()
{
    int c,d;
    printf("Enter tow number : ");
    scanf("%d %d",&a,&b);
    if(a>b)
    printf("Bigger number=%d\n",c);
    else
    printf("Bigger number=%d\n",d);
    return 0;
}

output


Enter tow number : 12
25
Bigger number=25

Steps Description

  1. Declare integer variable c and d
  2. printf inbuild function to display two value of variable c and d
  3. Evaluation of variable c and d to determine if less than d
  4. printf inbuild function to display value c bigger number

How to use while loop in C Language

Program to use while loop in C Language


#include <stdio.h>
int main()
{
    int i=1;
    while(i<=5)
    {
        printf("%d\t ",i);
        i++;
    }
    return 0;
}

Output


1 2 3 4 5
  1. Declare integer variable
  2. Initialize in integer variable i = 1
  3. While(i<=5) condition which needs to be evaluated
  4. pintf inbuild function to display the value of %d
  5. code of instructions which needs to be executed
  6. i++increment value

How to use sum control statements in c language

program to use sum control statements in c language


#include<stdio.h>
int main()
{
    int num,sum=0;
    do
    {
        printf("Enter a number (enter 0 to stop) : ");
        scanf("%d",&num);
        sum+=num;
    } while (num!=0);
    printf("sum is %d\n",sum);
    return 0;
    
}

output


Enter a number (enter 0 to stop) : 1
Enter a number (enter 0 to stop) : 4
Enter a number (enter 0 to stop) : 5
Enter a number (enter 0 to stop) : 7
Enter a number (enter 0 to stop) : 8
Enter a number (enter 0 to stop) : 0
sum is 25

Addition Operator JavaScript

Program to use Addition Operator JavaScript Language


let a = 10
let b = 20
let total;
total = a + b;
console.log("total number is = ", total);

 

Output


total number is = 30

Steps Description

  1. Declare three variables a, b and total
  2. Initialize both variables with value of 10 and 20 respectively a=10, b=20
  3. Assign total variable with Assignment Operators (=) with the sum/Addition value of variables a and b
  4. a, b variables की value को (+) Addition Operators ki सहयता से a+b numbers को adds/sum जोड़ा गया हैं
  5. console.log inbuilt function की मदद्द से total variable की value को display किया गया हैं