Data de publicació: Feb 08, 2017 10:3:2 AM
It prints repeatedly a character from 0 to a max number, like is showed below.
#include <stdio.h>
int main(){
int i, k, lines;
lines = 10;
i = 0;
while (i < lines){
for (k = 0; k <= i; k++) printf("$");
printf("\n");
i = i + 1;
}
}
Compiling and Output
[ikastenc@ikastenc while]$ make while_01
cc while_01.c -o while_01
[ikastenc@ikastenc while]$ ./while_01
$
$$
$$$
$$$$
$$$$$
$$$$$$
$$$$$$$
$$$$$$$$
$$$$$$$$$
$$$$$$$$$$
[ikastenc@ikastenc while]$