1. ## Small Problem with double and integer adding?

The Problem here is that when i write a double variable then a int variable i get no out put and are stuck waiting

Code:
```#include<iostream>
#include<windows.h>
#include<conio.h>
using namespace std;
double input(double, double);
int input(int, int);
double input(double, int);
int main()
{
cout.setf(ios::showpoint);
cout.setf(ios::showpos);
cout.setf(ios::fixed);
cout.precision(2);
int x = 0;
int y = 0;
int n = 0;
int run = 1;

double dnumber;
int inumber;

double dnumber2;
int inumber2;
char c;
while(run == 1)
{
while(n < 2)
{
cout <<"Do you want the number to be decimal placed or whole number <D> <W>?:";
for(;;)
{
if(n == 2)
{
system("cls");
break;
}
c=toupper(getch());

if(c == 'D')
{
if(x == 1)
{
system("cls");
cout <<"Input a number:";
cin >> dnumber2;
n = 2;
x = 2;
c = ' ';
}
if(x == 0)
{
system("cls");
cout <<"Input a number:";
cin >> dnumber;
n = n++;
x = 1;
c = ' ';
system("cls");
if(y == 0)
{
cout <<"Do you want the number to be decimal placed or whole number <D> <W>?:";
}
}
}
else if(c == 'W')
{
if(y == 1)
{
system("cls");
cout <<"Input a number:";
cin >> inumber2;
n = 2;
y = 2;
c = ' ';

}
if(y == 0)
{
system("cls");
cout <<"Input a number:";
cin >> inumber;
n = n++;
y = 1;
c = ' ';
system("cls");
if(x == 0)
{
cout <<"Do you want the number to be decimal placed or whole number <D> <W>?:";
}

}
}
}//for loop
} // While n < 2
if(x == 1 && y == 1)
{
system("PAUSE");
x = 0; n = 0; y = 0; dnumber = 0; inumber = 0; ianswer = 0; inumber2 = 0; dnumber2 = 0; danswer = 0; c = ' ';
}
else if(x == 0 && y ==2)
{
system("PAUSE");
x = 0; n = 0; y = 0; dnumber = 0; inumber = 0; ianswer = 0; inumber2 = 0; dnumber2 = 0; danswer = 0; c = ' ';
}
else if( x == 2 && y == 0)
{
system("PAUSE");
x = 0; n = 0; y = 0; dnumber = 0; inumber = 0; ianswer = 0; inumber2 = 0; dnumber2 = 0; danswer = 0;  c = ' ';
}
system("cls");
cout << "Do you wish to run this program again? <N> <Y>:";
for(;;)
{
c = toupper(getch());
if(c == 'N')
{
run = 0;
break;
}
else if(c == 'Y')
{
run = 1;
break;
}
}
system("cls");
} // While Run
return 0;
} // End main

double input(double num1, double num2)
{
double num3 = num1 + num2;
return(num3);
}
double input(double num1, int num2)
{
double num4 = (double) num2; //Even with out type casting same problem
double num3 = num4 + num1;
return(num3);
}
int input(int num1, int num2)
{
return(num1 + num2);
}```

2. My guess is that it is because of lines like that:

Code:
`n = n++;`
This is undefined behaviour (n may or may not be incremented).

I guess arrays might still help...

Code:
```#include <iostream>
#include <cctype>
using namespace std;

int main()
{
bool use_double[2];
double doubles[2];
int ints[2];

for (int i = 0; i != 2; ++i) {
cout <<"Do you want the number to be decimal placed or whole number <D> <W>?:";
char c;
do {
c = toupper(cin.get());
if (c == 'W') {
cout <<"Input a number:";
std::cin >> ints[i];
use_double[i] = false;
}
else if (c == 'D') {
cout <<"Input a number:";
std::cin >> doubles[i];
use_double[i] = true;
}
}while (c != 'W' && c != 'D');
}

cout.setf(ios::showpoint);
cout.setf(ios::showpos);
cout.setf(ios::fixed);
cout.precision(2);

if (!use_double[0] && !use_double[1]) {
cout << ints[0] + ints[1] << '\n';
}
else {
cout << (use_double[0] ? doubles[0] : ints[0]) + (use_double[1] ? doubles[1] : ints[1]) << '\n';
}
}```

3. You cut the code down alot :P well acauly the n++ thing u pointed out some how made a difference when i changed it to ++n

Well thank you. The reason i used all the functions cause i was testing out over loading

4. To increment a variable you do
Code:
```++n;

//or

n++;```
These operators work by side-effect and you can't modify (assignment) the same variable again in the same statement (the order of applying side-effects is undefined).