make code like this

0 qoley vision · September 12, 2015
/images/forum/upload/2015-09-12/8b535fa58681108f2cf3859b8441cb77.png
hello. anyone can make code like image above?

Post a Reply

Replies

Oldest  Newest  Rating
+1 Milan Obrenovic · September 13, 2015
it's very simple lol, here

#include <iostream>
#include <string>
using namespace std;

int main()
{
   cout << "\t\tJANUARY 2015 CALENDAR" << endl;
   cout << "\t\t---------------------" << endl;

   string dayNames[7] = { "Fri", "Sat", "Sun", "Mon", "Tue", "Wed", "Thu" };

   for (int i = 0; i < 7; i++)
   {
       cout << dayNames << "\t";
   }

   cout << endl;
   int sevenDays = 1;

   for (int i = 1; i <= 31; i++)
   {
       cout << i << "\t";

       if (sevenDays == 7)
{
   cout << endl;
   sevenDays = 0;
}

sevenDays++;
   }

   cout << endl << endl;

   system("pause");
   return 0;
}
0 Alan Masimba Walker · September 13, 2015
Have you tried to write something that formats output in such a way?
  • 1

C++

107,151 followers
About

Used in many types of software including music players, video games, and many large scale applications.

Links
Moderators
Bucky Roberts Administrator