0

Hey, Yet again i was just mucking around on DEV-C++ and made this code..

#include <conio.h>
#include <iostream>

using namespace std;

unsigned long Double(unsigned long doubleMe)
{
         return (2 * doubleMe);
}

int main()
{
    unsigned long numberToDouble;
    unsigned long doubledNumber;
       
    cout << "Enter a number you would like to double : ";
    cin >> numberToDouble;
    
    doubledNumber = numberToDouble;
    Double(doubledNumber);
    
    system("cls");
    
    cout << numberToDouble << " Doubled = " << doubledNumber;
    
    getch();
}

It is meant to cout the original number and then the doubled number, but if i enter 7, it cout's 7 doubled = 7

Help please?

I tried declaring it before using it but it said something like too many arguments,do i need to declarelike unsigned long Double(..); or not?

2
Contributors
2
Replies
3
Views
9 Years
Discussion Span
Last Post by Black Magic
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.