Last active
April 22, 2022 12:56
-
-
Save sorin-ref/ee0c74f1300f7cfc1cb6b99ae8b9c62b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
/* A - 1 data, B - de 2 ori, C - de 3 ori s.a.m.d. */ | |
void afiseaza_litera_de_un_numar_de_ori_potrivit(char c) | |
{ | |
for (char i = 'A'; i <= c; i++) | |
{ | |
printf("%c", c); | |
} | |
printf("\n"); | |
} | |
int main() | |
{ | |
char litera = 'A'; | |
while (litera <= 'H') | |
{ | |
afiseaza_litera_de_un_numar_de_ori_potrivit(litera); | |
litera++; | |
} | |
while (litera > 'A') | |
{ | |
litera--; | |
afiseaza_litera_de_un_numar_de_ori_potrivit(litera); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment