CodePaste Logo
New Snippet New Snippet Recent Snippets Recent Snippets My Snippets My Snippets Web Code Search Snippets Search
Sign inor Register
Format:
Recent snippets matching tags of number
C++
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){
by Pella86   December 23, 2011 @ 5:31pm
89 Views
no comments
 
C++
#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
by iscsi   July 27, 2011 @ 6:04am
76 Views
no comments
 
C++
/*
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
by niraj   April 09, 2011 @ 12:16pm
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;
by tiago.deliberali   January 05, 2010 @ 7:44am
327 Views
no comments
 
brought to you by:
West Wind Techologies



If you find this site useful and use it frequently please consider making a donation to support this free service.
Donate