Format:
Recent snippets matching tags of number
bool isPrimef(int n){ if (n == 1 ) return false; if (n < 4 ) return true; if (n % 2 == 0) return false; if (n < 9 ) return true; if (n % 3 == 0) return false; else{ int r = std::sqrt(n); int f = 5; while (f <= r){
89 Views
no comments
#include <algorithm> #include <iostream> #include <sstream> #include <string> #include <vector> #include <queue> #include <set> #include <map> #include <cstdio> #include <cstdlib>
76 Views
no comments
/*
WRITE A PROGRAM TO CALCULATE NUMBERS OF DAYS BETWEEN 1 JAN 1900 AND USER ENTERED DATE.
NOTE: 1900 was not leap year, after that every 4 year there is leap year 1904,1908, 1912 ...) upto 2096 .
now again 3000 is not leap year and so on after 3000 (3004, 3008, 30012 ) is leap year .
u can calulate that .
in case u know about leap year.
http://kalender-365.de/leap-years.php
109 Views
no comments
// get from // http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_20759950.html function fixedLengthNumber(num, size) { var str = num.toString(); var l = size - str.length; for (i = 0; i < l; i++) { str = "0" + str; } return str;
327 Views
no comments
Subscribe
Discuss
What's new
What is it
New Snippet
Recent Snippets
My Snippets
Web Code
Search
