Given the array declaration:
string DayNames[7] = {"Sunday","Monday","Tuesday","Wednesday"...
Write a C++ function void TellDay (string Week[], int DayNum) , so Friday will be displayed when call it with the statement:
TellDay(DayNames,5);
and Sunday will be displayed when the calling statement is:
TellDay(DayNames,7)
Can someone help with this C++ function?
#include %26lt;iostream.h%26gt;
int daynum, x;
string daynames[7] = {"Monday","Tuesday","Wednesday","Thursda... "Friday", "Saturday", "Sunday"};
void TellDay ()
{
x=daynum-1;
cout%26lt;%26lt;daynames[x];
}
void main()
{
cout%26lt;%26lt;"Enter day number";
cin%26gt;%26gt;daynum;
TellDay();
}
it works i tried it..
medium
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment