Hi. I gotta finesh this calendar but I'm having a problem with forcing numbers to start new line inside
while statement so output looks like this:

Can you guys tell me hoe to do it?
here is the code, code is very simple
CODE
#include<iostream>
#include<iomanip>
using namespace std;
int main()
{
int month, days, day, count=1;
cout<<"\t\t\t\tCalendar\n";
cout<<"Enter number of month: ";
cin>>month;
cout<<"Enter day of the month (1 for Sanday, 2 for Monday...): ";
cin>>day;
if (month ==1){cout<<"\n\t\t\tJanuary\n\n"; days=31;}
if (month ==2){cout<<"\n\t\t\tFebruary\n\n"; days=28;}
if (month ==3){cout<<"\n\t\t\tMarch\n\n"; days=31;}
if (month ==4){cout<<"\n\t\t\tApril\n\n"; days=30;}
if (month ==5){cout<<"\n\t\t\tMay\n\n"; days=31;}
if (month ==6){cout<<"\n\t\t\tJun\n\n"; days=30;}
if (month ==7){cout<<"\n\t\t\tJuly\n\n"; days=31;}
if (month ==8){cout<<"\n\t\t\tAogust\n\n"; days=31;}
if (month ==9){cout<<"\n\t\t\tSeptember\n\n"; days=30;}
if (month ==10){cout<<"\n\t\t\tOctober\n\n"; days=31;}
if (month ==11){cout<<"\n\t\t\tNovember\n\n"; days=30;}
if (month ==12){cout<<"\n\t\t\tDecember\n\n"; days=31;}
cout<<"\nSan\tMon\tTue\tWen\tThu\tFri\tSat\n";
while (count<=days){
switch(day){
case 1:
cout<<count<<"\t";break;
case 2:
cout<<"\t"<<count<<" "; break;
case 3:
cout<<"\t\t"<<count<<" "; break;}// by the way case 3 does not display correctly at all...
count++;}
return 0;
}
I recently started to study C++ snd I've been banging my head for two days now
This post has been edited by bels: 14 Mar, 2007 - 04:19 PM