fork download
  1. #include<iostream.h>
  2. #include<conio.h>
  3. char *months[]={"Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"};
  4. void cal(int yr,int mo,int fd,int da);
  5. void main(){
  6. int days[12]={31,28,31,30,31,30,31,31,30,31,30,31};
  7. long int ndays,ldays,tdays,tydays;
  8. int i,y,m,fday,d;
  9. clrscr();
  10. cout<<"Enter the YEAR & MONTH";
  11. cin>>y>>m;
  12. ndays=(y-1)*365l;
  13. ldays=(y-1)/400-(y-1)/100+(y-1)/4;
  14. tdays=ndays+ldays;
  15. if(y%400==0&&y%1001==0||y%4==0)
  16. days[1]=29;
  17. else
  18. days[1]=28;
  19. d=days[m-1];
  20. tydays=0;
  21. for(i=0;i<=m-2;i++)
  22. tydays=tydays+days[i];
  23. tdays=tdays+tydays;
  24. fday=tdays%7;
  25. cal(y,m,fday,d);
  26. }
  27. void cal(int yr,int mo,int fd,int da)
  28. {
  29. int i,r,c;
  30. clrscr();
  31. gotoxy(25,5);
  32. cout<<months[mo-1]<<yr;
  33. gotoxy(5,6);
  34. cout<<"_________________________________________________________";
  35. gotoxy(10,7);
  36. cout<<"Mon Tue Wed Thur Fri Sat Sun";
  37. gotoxy(5,8);
  38. cout<<"_________________________________________________________";
  39. r=10;
  40. c=11+fd*6;
  41. for(i=1;i<=da;i++){
  42. gotoxy(c,r);
  43. cout<<i;
  44. if(c<=41)
  45. c=c+6;
  46. else
  47. {
  48. c=11;
  49. r=r+1;
  50. }
  51. }
  52. gotoxy(5,16);
  53. cout<<"_________________________________________________________";
  54. getch();
  55. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cob:1: Warning: Invalid indicator 'u' at column 7
prog.cob:4: Warning: Invalid indicator 'm' at column 7
prog.cob:18: Warning: Invalid indicator 's' at column 7
prog.cob:27: Warning: Invalid indicator ',' at column 7
prog.cob:29: Warning: Invalid indicator 'r' at column 7
prog.cob:40: Warning: Invalid indicator '=' at column 7
prog.cob:52: Warning: Invalid indicator '<' at column 7
prog.cob:54: Warning: File not terminated by a newline
prog.cob:56: Error: syntax error
stdout
Standard output is empty