Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

WTF

Name: Anonymous 2008-10-07 12:46

Hey /prog/ can anyone tell me what the hell is going on in this program?

#include <iostream>
using namespace std;

void fun (int data);
void mystery(int data);
void main( )
{
    int data;
    bool start =true;
   
    cout<<"Please enter an integer value : ";
    cin>>data;
    fun(data);
    mystery(data);
   
   
}

void fun(int count)
{
    char index = count;
    while(index >= 0)
    {
        cout<<index;
        index--;
    }
}

void mystery(int count)
{
    char index = count;
    while(index<count)
    {
        cout<<count;
        index++;
    }
}

Name: Anonymous 2008-10-09 3:57

>>16
MORON WHO DOESN'T REALIZE THAT CHAR AND INT CAN BE THE SAME SIZE, AND CHAR CAN EVEN BE LARGER THAN INT.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List