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);
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
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