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?

Recommended Answers

All 2 Replies

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.