Created
April 22, 2022 12:13
-
-
Save sorin-ref/ecbf601222fefb3f9bad2cb52ab0af75 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. */ | |
/* A-C: litere mari, d-h: litere mici */ | |
void afiseaza_litera_cu_casing_potrivit_de_un_numar_de_ori_potrivit(char c) | |
{ | |
char de_afisat = c; | |
if (c >= 'D') | |
{ | |
de_afisat = c + ('a' - 'A'); | |
} | |
for (char i = 'A'; i <= c; i++) | |
{ | |
printf("%c", de_afisat); | |
} | |
printf("\n"); | |
} | |
int main() | |
{ | |
char litera = 'A'; | |
while (litera <= 'H') | |
{ | |
afiseaza_litera_cu_casing_potrivit_de_un_numar_de_ori_potrivit(litera); | |
litera++; | |
} | |
while (litera > 'A') | |
{ | |
litera--; | |
afiseaza_litera_cu_casing_potrivit_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