ATTEMPT THE TASKS BELOW
Note:
- All Solutions Must be Pushed to your Github repository - "
as stated in the questions" (Remember to clone this repository in your local terminal)
All Solutions Must be in the Directory - "
as stated in the questions" and there should be a README.md file in this directory.- Execute all Scripts using the command: chmod u+x <filename>
- Take note of the filename of each task.
- You are free to use any of the following editors:
vi
,vim
,emacs.
Use the
Betty comment
style.
Answer:
#include "main.h" /** | |
* main - This program prints the phrase _putchar | |
* Return: 0 | |
*/ | |
int main(void) | |
{ | |
char ch[] = "_putchar"; | |
int i; | |
for (i = 0; ch[i] != '\0'; i++) | |
{ | |
_putchar(ch[i]); | |
} | |
_putchar('\n'); | |
return (0); | |
} |
#include "main.h" /** | ||||||||||||||||||||||||||||||||||||||
* print_alphabet - Starting point | ||||||||||||||||||||||||||||||||||||||
* Return: Always 0. | ||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||
void print_alphabet(void) | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
char c; | ||||||||||||||||||||||||||||||||||||||
for (c = 'a'; c <= 'z'; c++) | ||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||
_putchar(c); | ||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||
_putchar('\n'); | ||||||||||||||||||||||||||||||||||||||
}
Answer:
|
#include "main.h" /** | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* _islower - Code entry point | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Description: This program checks for lowercase character. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* @c: The integer value it recieves | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
* Return: 0 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int _islower(int c) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
int i = 'a'; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
for (i = 'a'; i <= 'z'; i++) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
/* refer in c*/ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
if (c == i) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
{ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return (1); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
return (0); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||
}
Answers:
|
0 Comments