Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

calender problem in C

parramparram Member Posts: 4
i want to print out the months of a year which is enterd by the user in the following format. how to do?

Jan Feb Mar
S M T W T F S S M T W T F S S M T W T F S
1 2 3 4 5 6 7 - - - - - - - - - - - - - -
8 9 10 11 12 13 14 same here same here
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 31

3 months on each row, so 12 months have to be printed. please help.
this is my first posting - hello all

Comments

  • CowboyDanCowboyDan Member Posts: 5
    : i want to print out the months of a year which is enterd by the user in the following format. how to do?
    :
    : Jan Feb Mar
    : S M T W T F S S M T W T F S S M T W T F S
    : 1 2 3 4 5 6 7 - - - - - - - - - - - - - -
    : 8 9 10 11 12 13 14 same here same here
    : 15 16 17 18 19 20 21
    : 22 23 24 25 26 27 28
    : 29 30 31
    :
    : 3 months on each row, so 12 months have to be printed. please help.
    : this is my first posting - hello all
    :
    I'd just print it out. There's no use in using counters and loops and all that.
  • parramparram Member Posts: 4
    : : i want to print out the months of a year which is enterd by the user in the following format. how to do?
    : :
    : : Jan Feb Mar
    : : S M T W T F S S M T W T F S S M T W T F S
    : : 1 2 3 4 5 6 7 - - - - - - - - - - - - - -
    : : 8 9 10 11 12 13 14 same here same here
    : : 15 16 17 18 19 20 21
    : : 22 23 24 25 26 27 28
    : : 29 30 31
    : :
    : : 3 months on each row, so 12 months have to be printed. please help.
    : : this is my first posting - hello all
    : :
    : I'd just print it out. There's no use in using counters and loops and all that.

    thanx. but when i print it out the months appear vertically like
    Jan
    ------
    -------
    Feb
    ------
    --------
    & so on. Is there any way that i can print them out horizontally?

  • CowboyDanCowboyDan Member Posts: 5
    : : : i want to print out the months of a year which is enterd by the user in the following format. how to do?
    : : :
    : : : Jan Feb Mar
    : : : S M T W T F S S M T W T F S S M T W T F S
    : : : 1 2 3 4 5 6 7 - - - - - - - - - - - - - -
    : : : 8 9 10 11 12 13 14 same here same here
    : : : 15 16 17 18 19 20 21
    : : : 22 23 24 25 26 27 28
    : : : 29 30 31
    : : :
    : : : 3 months on each row, so 12 months have to be printed. please help.
    : : : this is my first posting - hello all
    : : :
    : : I'd just print it out. There's no use in using counters and loops and all that.
    :
    : thanx. but when i print it out the months appear vertically like
    : Jan
    : ------
    : -------
    : Feb
    : ------
    : --------
    : & so on. Is there any way that i can print them out horizontally?
    :
    :
    Instead of just printing them out you could put them in a 2d array that is the same size as the screen (I think it's 80 X 25). Then you could make a function that puts a 2d array (a month) into that 2d array (a year) at an x, y position. So you can put the first one at (0, 0) and the second at (22, 0) and the third one at (44, 0). After that just make two more rows and you will have a 2d array with all of the information in it. Then all you will have to do is print out the 2d array.
  • parramparram Member Posts: 4
    : : : : i want to print out the months of a year which is enterd by the user in the following format. how to do?
    : : : :
    : : : : Jan Feb Mar
    : : : : S M T W T F S S M T W T F S S M T W T F S
    : : : : 1 2 3 4 5 6 7 - - - - - - - - - - - - - -
    : : : : 8 9 10 11 12 13 14 same here same here
    : : : : 15 16 17 18 19 20 21
    : : : : 22 23 24 25 26 27 28
    : : : : 29 30 31
    : : : :
    : : : : 3 months on each row, so 12 months have to be printed. please help.
    : : : : this is my first posting - hello all
    : : : :
    : : : I'd just print it out. There's no use in using counters and loops and all that.
    : :
    : : thanx. but when i print it out the months appear vertically like
    : : Jan
    : : ------
    : : -------
    : : Feb
    : : ------
    : : --------
    : : & so on. Is there any way that i can print them out horizontally?
    : :
    : :
    : Instead of just printing them out you could put them in a 2d array that is the same size as the screen (I think it's 80 X 25). Then you could make a function that puts a 2d array (a month) into that 2d array (a year) at an x, y position. So you can put the first one at (0, 0) and the second at (22, 0) and the third one at (44, 0). After that just make two more rows and you will have a 2d array with all of the information in it. Then all you will have to do is print out the 2d array.
    :
    thanx a lot. i'll try it now
  • Shawn CarterShawn Carter Member Posts: 0

    ____ ( http://forcoder.org ) free video tutorials and ebooks about \ Visual Basic .NET Go C++ Python Ruby Perl R C# PHP MATLAB Java Assembly JavaScript Delphi Swift Objective-C Visual Basic C PL/SQL Scratch SAS Ada Dart Logo Lua Prolog Alice Julia VBScript Lisp Crystal Fortran ML Bash LabVIEW Kotlin FoxPro ABAP Scala Awk Erlang COBOL F# Hack Rust Apex D Transact-SQL Clojure Scheme \ _____

Sign In or Register to comment.