Click here to Skip to main content
15,917,320 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: numbers with boxes Pin
David Crow21-Oct-09 4:08
David Crow21-Oct-09 4:08 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 4:22
kbury21-Oct-09 4:22 
QuestionRe: numbers with boxes Pin
David Crow21-Oct-09 4:29
David Crow21-Oct-09 4:29 
AnswerRe: numbers with boxes Pin
kbury21-Oct-09 4:39
kbury21-Oct-09 4:39 
GeneralRe: numbers with boxes Pin
David Crow21-Oct-09 4:46
David Crow21-Oct-09 4:46 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 4:53
kbury21-Oct-09 4:53 
GeneralRe: numbers with boxes Pin
David Crow21-Oct-09 4:57
David Crow21-Oct-09 4:57 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 5:40
kbury21-Oct-09 5:40 
changed code to this

<#include <stdio.h>  /*Include header*/
#include <stdlib.h>
#include <assert.h>

#define mbxhgt  6
#define mbxwid  4

int main (void)
{
int    rows,
       cols,
	   r = 1,
	   c = 1,
	   boxnum = 1,
	   unit_height,
	   unit_width;

system("cls");

printf ("Mailbox Layout Program\n\n");

printf ("How many rows of mailboxes will there be?");
scanf ("%d", &rows);

printf ("\nHow many columns of mailboxes will there be?");
scanf ("%d", &cols);

printf ("\n\nThe numbering layout will be:\n");
printf("+---+---+---+---+---+\n|");

while (c <= cols)

	{c = c + 1;

	printf (" %d |", boxnum);
	boxnum = boxnum + 1;
	}

while (r <= rows)
	{r = r + 1;

	printf ("\n \n");

if (boxnum <= 1);
    printf("| %d | ", boxnum++);}


unit_height = rows * mbxhgt;
unit_width = cols * mbxwid;

printf ("\nOverall height of mailbox unit: %d", unit_height);
printf ("\nOverall width of mailbox unit: %d\n", unit_width);


return (0);
}/pre>

now looks like this:

How many rows of mailboxes will there be?4

How many columns of mailboxes will there be?5


The numbering layout will be:
+---+---+---+---+---+
| 1 | 2 | 3 | 4 | 5 |

| 6 |

| 7 |

| 8 |

| 9 |
Overall height of mailbox unit: 24
Overall width of mailbox unit: 20

GeneralRe: numbers with boxes Pin
David Crow21-Oct-09 5:43
David Crow21-Oct-09 5:43 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 5:52
kbury21-Oct-09 5:52 
QuestionRe: numbers with boxes Pin
David Crow21-Oct-09 6:03
David Crow21-Oct-09 6:03 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 6:32
kbury21-Oct-09 6:32 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 6:53
kbury21-Oct-09 6:53 
QuestionRe: numbers with boxes Pin
David Crow21-Oct-09 7:04
David Crow21-Oct-09 7:04 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 7:31
kbury21-Oct-09 7:31 
GeneralRe: numbers with boxes Pin
David Crow21-Oct-09 7:36
David Crow21-Oct-09 7:36 
GeneralRe: numbers with boxes Pin
kbury21-Oct-09 7:47
kbury21-Oct-09 7:47 
QuestionRe: numbers with boxes Pin
David Crow21-Oct-09 7:59
David Crow21-Oct-09 7:59 
Questioncode to convert regular expression into dfa Pin
lavanya229021-Oct-09 1:34
lavanya229021-Oct-09 1:34 
AnswerRe: code to convert regular expression into dfa Pin
Hans Dietrich21-Oct-09 2:00
mentorHans Dietrich21-Oct-09 2:00 
QuestionRe: code to convert regular expression into dfa Pin
David Crow21-Oct-09 7:14
David Crow21-Oct-09 7:14 
QuestionHow to restore view settings in Dialog?? Pin
002comp21-Oct-09 0:25
002comp21-Oct-09 0:25 
AnswerRe: How to restore view settings in Dialog?? Pin
Hans Dietrich21-Oct-09 0:40
mentorHans Dietrich21-Oct-09 0:40 
GeneralRe: How to restore view settings in Dialog?? Pin
002comp21-Oct-09 1:03
002comp21-Oct-09 1:03 
AnswerRe: How to restore view settings in Dialog?? Pin
CPallini21-Oct-09 0:48
mveCPallini21-Oct-09 0:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.