i have this assignment which I have no clue how to do it
so i was wondering if u guys could help with it
the question is :
Write a C++ program which contains three functions:
First function prints multiple of 4 between two numbers x and y.
Second function returns number of odd numbers between x and y.
Third function swaps two elements x and y.
Note : The user should enter x and y in the main function .
"Pseudo" means false. Pseudo-code is "fake" code. It's a way to write out a programming task using simple english so that you can better see the logic without the confusion of programming language syntax, rules, etc.
ok here are three of the function i should use
the 1st one
void initialize (int& lc, int list[])
{
int j ;
lc=0;
for ( j = 0; j < 26; J++)
list[j] =0;
}
//end initialize
the 2nd one
void characterCount (char ch, int list[])
{
int index;
ch = toupper (ch);
index = static_cast<int> (ch) _ static_cast<int> ( 'A');
if ( 0<= index && index < 26)
list[index]++;
}
// end characterCount
wow i'm really confused here you ask for help on some logical mathematics problem and you give us string manipulation code what are you trying to achieve?
You've got to be kidding me. String manipulation functions to create arithmetic functions. That... probably isn't right. Are you sure that you're not supposed to write your functions from scratch?
So basically you have no clue? Why don't you write a small program, create the functions with no bodies and set everything up how you think you'd do it. That way we can tell you if you're on the right track and maybe do one of the functions for you to show you how it's done. But you can setup the structure for it first.