global variable not comming up

i am trying to write the global variable b4 the initialization but its not working, i am trying to call odd into even and even into odd, but i am really stuck in here dont know what to do pls help me out.



#include "stdafx.h"
#include <iostream>

using namespace std;

void odd (int a)
{
if ((a%2) !=0)
cout << "the number is odd: ";
else even (d) ;
}

void even (int d)
{
if ((d%2) ==0)
cout << "The number is even: ";
else odd (a);
}
void decimal (float a, float b, float c)
{
if (c = a/b)
cout << "the number is decimal: ";

}
int main ()
{
int m;
do {
cout << "please enter number (0) to end: ";
cin >> m;
cout << odd;
cout << even;
cout << decimal;
}
while (m>0);

system ("pause");

return 0;
}

There is no any global variable in your proggam.
Last edited on
but what about the (odd and even) are they not global scope. i am a newbie, i just got stuck help me out pls. it keep telling me that "even is an undecleared identifier ";
if with examples. will be very glad
odd and even are functions that take one parameter. But you are calling them without speciifing function call syntax.
how do i specify it and how do i put them in one parameter. pls give example or do correction to ma mistake. thanks
Please read at least one book on C++ programming or stop to program in general
Those are functions not global variables.

And you call them by just putting their name followed by their parameters.

You don't use "cout" or "cin" to call functions.
Hint: the system("PAUSE"); you used is no more a function than odd(), even() and decimal().
O.M.G @vlad am not the 1 who posted this it was ma cousin and he his a small boy trying to get something, and beside u dont need to discourage him, beside you also started from one place. i just logged in today and i need help on this question "If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000."

i dont know how to start with it.
am i going to use two variable to get started or what? and i am really having probs with the "for" loops i dont understand it well
Topic archived. No new replies allowed.