GIDForums  

Go Back   GIDForums > Computer Programming Forums > C Programming Language
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 17-Apr-2015, 02:32
markymark markymark is offline
New Member
 
Join Date: Apr 2015
Posts: 1
markymark is on a distinguished road

Do while


Can someone please explain how i get from the for to do while for this program please.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <stdio.h>

int main(void)
{

printf(" |");

for (int i = 1; i < 13; ++i)
{
printf("%3d ", i);

}
printf("\n");


for (int i = 1; i < 75; ++i)
{
printf("-");
}
printf("\n");


for (int i = 1; i < 13; ++i)
{
printf("%2d |", i);
for (int j = 1; j < 13; ++j)
{
printf("%3d ", i * j);
}
printf("\n");
}

return 0;
}
  #2  
Old 27-Sep-2015, 09:12
metryc metryc is offline
New Member
 
Join Date: Jan 2011
Location: Sunny Florida
Posts: 6
metryc is on a distinguished road

Re: Do while


For your first for( use this:
CPP / C++ / C Code:
int i = 1;
do {
  printf("%3d ", i);
  i++;
} while (i < 13)
  #3  
Old 27-Oct-2015, 01:00
lindseynicole lindseynicole is offline
New Member
 
Join Date: Oct 2015
Posts: 13
lindseynicole has a little shameless behaviour in the past

Re: Do while


Thanks Metryc.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Network Sites: GIDNetwork · GIDApp · GIDBlog · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:13.


vBulletin, Copyright © 2000 - 2017, Jelsoft Enterprises Ltd.