Click here to Skip to main content
15,894,539 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Hello world... please help [modified] Pin
Nelek13-May-07 20:49
protectorNelek13-May-07 20:49 
GeneralRe: Hello world... please help Pin
Christian Graus13-May-07 20:54
protectorChristian Graus13-May-07 20:54 
GeneralRe: Hello world... please help Pin
WakenDJ13-May-07 20:58
WakenDJ13-May-07 20:58 
GeneralRe: Hello world... please help Pin
Christian Graus13-May-07 21:46
protectorChristian Graus13-May-07 21:46 
GeneralRe: Hello world... please help Pin
WakenDJ13-May-07 22:14
WakenDJ13-May-07 22:14 
GeneralRe: Hello world... please help Pin
Christian Graus13-May-07 22:34
protectorChristian Graus13-May-07 22:34 
GeneralRe: Hello world... please help Pin
Nelek13-May-07 22:53
protectorNelek13-May-07 22:53 
GeneralRe: Hello world... please help Pin
Nelek13-May-07 22:27
protectorNelek13-May-07 22:27 
But this will give:

**********
**********
**********
and so on, as output. And that was not the question.

There principle is this, but there is two ways to do it.

1)
int i = 0, j = 0;
for (i = 1; i <= 10; i++)
{
for (j = 1; j <= i; j++)
printf ("*");

printf ("\n");
}

the first loop determines the line and the number of stars, and the second wirte all the stars from 1 till the number of the line.

2)
int i = 0, j = 0;
for (i = 1; i <= 10; i++)
{
for (j = 1; j <= 10; j++)
{
printf ("*");
if (j == i)
break;
}

printf ("\n");
}

This is more or less the same as the first one, but putting both limits to 10 and breaking the second loop when it reaches the number of the line (and consecuentally the number of stars that should be written)

EDIT: With the do... while is more or less the same, in my previous message (chronologically, but below this one in forum-space) I have written you the differences and structure of for, while and do.. while.

Just translate it to whatever you want to use and we correct you

--------
M.D.V.

If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?

GeneralRe: Hello world... please help Pin
Nelek13-May-07 20:46
protectorNelek13-May-07 20:46 
GeneralRe: Hello world... please help Pin
David Crow14-May-07 3:27
David Crow14-May-07 3:27 
QuestionHello world... help Pin
WakenDJ13-May-07 17:23
WakenDJ13-May-07 17:23 
AnswerRe: Hello world... help Pin
amets13-May-07 22:53
amets13-May-07 22:53 
QuestionThreadpool Linker Problem Pin
Cyrilix13-May-07 12:35
Cyrilix13-May-07 12:35 
AnswerRe: Threadpool Linker Problem Pin
led mike13-May-07 15:44
led mike13-May-07 15:44 
GeneralRe: Threadpool Linker Problem Pin
Cyrilix13-May-07 16:59
Cyrilix13-May-07 16:59 
QuestionProblem with print function ? Pin
Lewis0113-May-07 10:31
Lewis0113-May-07 10:31 
AnswerRe: Problem with print function ? Pin
bob1697213-May-07 10:57
bob1697213-May-07 10:57 
GeneralRe: Problem with print function ? Pin
Lewis0113-May-07 11:05
Lewis0113-May-07 11:05 
GeneralRe: Problem with print function ? Pin
bob1697213-May-07 11:27
bob1697213-May-07 11:27 
GeneralRe: Problem with print function ? Pin
David Crow14-May-07 3:34
David Crow14-May-07 3:34 
QuestionTrying to use m_strSort with OLE DB Pin
Lewis0113-May-07 10:27
Lewis0113-May-07 10:27 
QuestionMemory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 8:04
dum13-May-07 8:04 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
bob1697213-May-07 9:30
bob1697213-May-07 9:30 
QuestionRe: Memory leak found after reporting "No memory leaks detected" Pin
dum13-May-07 11:16
dum13-May-07 11:16 
AnswerRe: Memory leak found after reporting "No memory leaks detected" Pin
bob1697213-May-07 12:06
bob1697213-May-07 12:06 

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.