I have this code. write a code that asks for a number and define 2 functions. the first must return the remainder of the number by dividing by 7 and the second must return the day of the week (0 =Sunday 1=Monday .. 6=Saturday). so far i have done this:
BUT when i run it , it gives me this error --> redefinition of 'int main()' what does this mean and what do i have to fix?
BUT when i run it , it gives me this error --> redefinition of 'int main()' what does this mean and what do i have to fix?
Code:
#include <iostream> using namespace std; int myNumbers(int a) { return a % 7; } void myFuction(string); int main() { int a; cout << "give a number between 0-6: \n"; cin >> a; cout << "the result is " << myNumbers(a); } int main() { myFuction("sunday"); myFuction("monday"); myFuction("tuesday"); myFuction("thursady"); myFuction("wendsday"); myFuction("friday"); myFuction("saturday"); return 0; cout << "then day is:" << myFunction(); }
Comment