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-07 14:40


#include <stdio.h>

void fun (int data);
void mystery(int data);
void main(){
    int data;
    bool start=true;
  
    printf("Please enter an integer value : ");
    scanf("%d",&data);
    fun(data);
    mystery(data);
  
}

void fun(int count){
    char index = count;
    while(index >= 0){
        printf("%c",index);
        index--;
    }
}

void mystery(int count){
    char index = count;
    while(index<count){
        printf("%d",count);
        index++;
    }
}

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