Toggle navigation
Home
Latest pastes
FAQ
Random
BitBin is shutting down!
Register
Login
C++: print out 10 lines of 5 $ signs using the nested loop
SUBMITTED BY:
Guest
DATE:
Oct. 28, 2013, 3:58 p.m.
FORMAT:
C++
SIZE:
458 Bytes
Raw
Download
Tweet
HITS:
838
Go to comments
Report
// PURPOSE: To write a program that print out 10 lines of 5 $ signs using the nested loop
#include
<stdio.h>
int
main
()
{
int
i
;
// row number, goes from 1 to 10
int
j
;
// column number, goes from 1 to 5
i
=
1
;
while
(
i
<=
10
)
{
j
=
1
;
while
(
j
<=
5
)
{
printf
(
"$"
);
j
=
j
+
1
;
}
i
=
i
+
1
;
printf
(
"
\n
"
);
}
getchar
();
getchar
();
return
0
;
}
Please enable JavaScript to view the
comments powered by Disqus.
comments powered by
Disqus