Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //VERTICAL -
- #include <stdio.h>
- #include <stdlib.h>
- int main () {
- char str[30];
- printf("Digite uma string: ");
- scanf("%s", str);
- int i = 0;
- while (str[i])
- printf("%c\n",str[i++]);
- }
- //DIAGONAL
- int
- main ()
- {
- char str[30];
- printf ("Digite uma string: ");
- scanf ("%s", str);
- for (int i = 0; str[i]; i++)
- {
- for (int j = 0; j < i; j++)
- {
- printf (" ");
- }
- printf ("%c\n", str[i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement