Programming, Music, Games. Creation.

[C++] Binary Swift v1

NOTE (Added 13/2/14) : Back then, I thought binary = 2bin, decimal = 10bin, hexadecimal = 16 etc. Therefore, there are mistakes in this post!!

simple version! :D

only input 10and  8bin,

Error occurs if u input 16 ir ASCII

/*
Created by Max
Bermuda’s Unscapable Triangle
https://maxisbac.wordpress.com/

version 1
*/

#include <iostream>
#include <windows.h>
#include <stdio.h>

int iNumber;

int main()
{
std::cout << “Input Any number :)\n”;
std::cin >> iNumber;//input

printf(“\n16 bin : %x\n”, iNumber);
printf(“10 bin : %d\n”, iNumber);
printf(“8 bin : %o\n”, iNumber);
printf(“ASCII : %c\n\n”, iNumber);
//simple :D

system(“pause”);//Dos :) – pause
system(“cls”);//Dos :) – cls (clear screen)
main();//back to front
}

Advertisements

2 responses

  1. Thank you for a great post.

    14/05/2011 at 1:45 PM

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s