Posted On: Dec 24, 2020
A prime number is a whole number greater than 1, which is only divisible by 1 and itself.
// function check whether a number // is prime or not bool isPrime(int n) { // Corner case if (n <= 1) return false; // Check from 2 to n-1 for (int i = 2; i < n; i++) if (n % i == 0) return false; return true; }
Never Miss an Articles from us.
The STP also stands for Spanning Tree Protocol constructs a loop-free logical topography for Ethernet networks. It is a ..
A regular expression to validate phone number in XXX-XXX-XXXX format is follows: /^(?:\(\d{3}\)|\d{3}-)\d{3}-\d{4}$/...
The du command shows the disk space used by the directory or file....