Skip to content

Commit 866bf18

Browse files
committed
update alpha lowercase code
1 parent d210228 commit 866bf18

File tree

3 files changed

+31
-14
lines changed

3 files changed

+31
-14
lines changed
+10-7
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#include "main.h"
2+
23
/**
3-
* print_alphabet - entry point
4-
* Description: print alphabet then new line.
5-
* Return: Always void.
4+
* print_alphabet - Entry point
5+
* Description: prints the alphabet lowecase then new line
6+
* Return: void
67
*/
78
void print_alphabet(void)
89
{
9-
char ch = 'a';
10-
11-
while (ch <= 'z')
10+
char letter = 'a';
11+
12+
while (letter <= 'z')
1213
{
13-
_putchar(ch);
14+
_putchar(letter);
15+
letter++;
1416
}
1517
_putchar('\n');
1618
}
19+
+10-7
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
1-
#include <stdio.h>
2-
/* _putchar - entry point
3-
* Description: print char to cout
4-
* Return: 0 (Success)
1+
#include <unistd.h>
2+
3+
/**
4+
* _putchar - print the character ch to cout
5+
* @ch: The character to print
6+
*
7+
* Return: 0 Success.
8+
* On error, -1 is returned, and errno is set appropriately.
59
*/
6-
int _putchar(int ch)
10+
int _putchar(char ch)
711
{
8-
putchar(ch);
9-
return (0);
12+
return (write(1, &ch, 1));
1013
}

0x02-functions_nested_loops/main.h

+11
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,13 @@
11
int _putchar(char ch);
22
void print_alphabet(void);
3+
void print_alphabet_x10(void);
4+
int _islower(int c);
5+
int _isalpha(int c);
6+
int print_sign(int n);
7+
int _abs(int);
8+
int print_last_digit(int);
9+
void jack_bauer(void);
10+
void times_table(void);
11+
int add(int, int);
12+
void print_to_98(int n);
13+
void print_times_table(int n);

0 commit comments

Comments
 (0)