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
- Declare three variables
a, b
andc
- Initialize both variables with value of 5 and 2 respectively
a=5, b=2
- Assign
c
variable with Assignment Operators (=
) with the remainder/percentage value of variablesa
andb
a, b
variables की value को (%
) Modulus Operators ki सहयता सेa%b
numbers को remainder/percentage किया गया हैंconsole.log
inbuilt function की मदद्द सेc
variable की value को display किया गया हैं