Subdomain Posts
C++ | 8 hours ago
C++ | 9 hours ago
C | 9 hours ago
C++ | 10 hours ago
C | 3 days ago
C | 5 days ago
C | 5 days ago
C | 5 days ago
SQL | 5 days ago
C | 6 days ago
Recent Posts
C | 31 sec ago
None | 35 sec ago
None | 1 min ago
HTML | 1 min ago
None | 1 min ago
None | 1 min ago
PHP | 2 min ago
None | 2 min ago
None | 2 min ago
None | 2 min ago
Sitereport
Find cool info about any domain on the internet?
visit sitereport
Free Subdomains
Want a pastebin.com sub-domain for your community?
learn more...
What is pastebin?
Pastebin is a website that hosts all your text & code on dedicated servers for easy sharing.
learn more...
By Anonymous on the 3rd of Feb 2010 10:45:28 AM
Download |
Raw |
Embed |
Report
include <stdio.h>
#include <stdlib.h>
int main(int argc, char **argv) {
/* Read the single command line argument and convert it
* to an integer.
*/
if (argc != 2) {
fprintf(stderr,"Usage is %s <number>\n", argv[0]);
exit(1);
}
const unsigned int n = atoi(argv[1]);
unsigned int p;
for (p = 1; p <= n; p = p << 1) {}
for (p = p >> 1; p > 0; p = p >> 1)
{
if ((p & n) == p)
putchar('1');
else
putchar('0');
}
putchar('\n');
return 0;
}
Submit a correction or amendment below.
Make A New Post