Hi,
Line 33, remove the semicolon.
On line 37, there is no need for the cin, input happens inside your function already.
Your function
Dita takes one argument (an
int) and returns an
int
Because everything happens inside your function, there is no need for it to take an argument or return anything, so consider changing the function to:
1 2 3 4 5 6 7
|
void Dita()
{
.
.
.
}
|
Edit: Remove line 30, we are not returning anything any more. Btw having just 1 return in the
default: case is bad news, it may never be reached. A function declared to return a value of a certain type, must actually return something in all cases.
and
main() becomes:
1 2 3 4 5 6 7
|
int main()
{
std::cout << "Dita e javes eshte:\n"; // newline added
Dita(); // function call with parentheses
return 0;
}
|
Also, avoid having more than 1 statement per line. I personally find that harder to read, but it is not a strict rule.
I also like
main() at the top of the file, so this means putting a forward declaration of your function, and placing the function itself after
main(), that way
main() is easy to find:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
#include<iostream>
// eventually you should avoid doing this - Google it :+)
// using namespace std;
// Replace cout with std::cout, and cin with std::cin, any other std thing has std:: before it
//sorry if this is too advanced right now :+)
void Dita(); // forward declaration of function
int main()
{
std::cout << "Dita e javes eshte:\n"; // newline added
Dita(); // function call with parentheses
return 0;
}
// function definition
void Dita()
{
.
.
.
}
|
Good Luck !!