ex3-1.c
/* code: ex3-1.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
for (i = 0; i < 10; i++)
printf ("%d ", i);
return 0;
}
ex3-10.c
/* code: ex3-10.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (1) {
printf ("%d ", i);
if (i == 5) {
i = 0;
break;
}
i++;
}
return 0;
}
ex3-11.c
/* code: ex3-11.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (1) {
printf ("%d ", i);
if (i == 5) {
i = 0;
continue;
}
i++;
}
return 0;
}
ex3-2.c
/* code: ex3-2.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
for (i = 0; i < 10; i++) {
printf ("%d", i);
if (0 != (i % 2))
printf (":odd ");
else
printf (":even ");
}
return 0;
}
ex3-3.c
/* code: ex3-3.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i, j;
for (i = 1; i < 10; i++) {
for (j = 1; j < 10; j++) {
printf ("%02d ", i * j);
}
printf ("\n");
}
return 0;
}
ex3-4.c
/* code: ex3-4.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
for (;;) {
printf ("%d ", i);
i++;
}
return 0;
}
ex3-5.c
/* code: ex3-5.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (i < 10)
printf ("%d ", i++);
return 0;
}
ex3-6.c
/* code: ex3-6.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (i < 10) {
printf ("%d ", i);
i++;
}
return 0;
}
ex3-7.c
/* code: ex3-7.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
do {
printf ("%d ", i);
i++;
} while (i < 10);
return 0;
}
ex3-8.c
/* code: ex3-8.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i, j;
i = 1;
while (i < 10) {
j = 1;
while (j < 10) {
printf ("%02d ", i * j);
j++;
}
printf ("\n");
i++;
}
return 0;
}
ex3-9.c
/* code: ex3-9.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (1) {
printf ("%d ", i);
i++;
}
return 0;
}
q3-1.c
/* code: q3-1.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
for (i = 0; i < 100; i++)
printf ("%d ", i);
return 0;
}
q3-2.c
/* code: q3-2.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
for (i = 9; i >= 0; i--)
printf ("%d ", i);
return 0;
}
q3-3.c
/* code: q3-3.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i;
i = 0;
while (i < 100) {
printf ("%d ", i);
i++;
}
return 0;
}
q3-4.c
/* code: q3-4.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i, j, k;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) {
printf ("%d %d %d", i, j, k);
printf ("\n");
}
}
}
return 0;
}
q3-5.c
/* code: q3-5.c (v1.20.00) */
#include <stdio.h>
int main ()
{
int i, j, k;
for (i = 0; i < 2; i++) {
for (j = 0; j < 2; j++) {
for (k = 0; k < 2; k++) {
printf ("%d ", i * j + k);
}
}
}
return 0;
}
EOF