Skip to content

Instantly share code, notes, and snippets.

@sorin-ref
Last active April 22, 2022 12:56
Show Gist options
  • Save sorin-ref/ee0c74f1300f7cfc1cb6b99ae8b9c62b to your computer and use it in GitHub Desktop.
Save sorin-ref/ee0c74f1300f7cfc1cb6b99ae8b9c62b to your computer and use it in GitHub Desktop.
#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