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 questionsand 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: vivimemacs.
  • 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);
}





Answer:


#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" /**
* print_alphabet_x10 - This function prints the alphabet 10 times
* in lowercase, followed by a newline
*/
void print_alphabet_x10(void)
{
int ch, i;
for (i = 0; i < 10; i++)
{
for (ch = 'a'; ch <= 'z'; ch++)
{
_putchar(ch);
}
_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:
#include "main.h"
/*
*
* _isalpha - Code entry.
*
* Description: A function that checks for alphabetic character.
*
* @c: The integer value it recieves
*
* Return: 0
*/
int _isalpha(int c)
{
char cap_alphabet, icap_alphabet;
for (cap_alphabet = 'a'; cap_alphabet <= 'z'; cap_alphabet++)
{
for (icap_alphabet = 'A'; icap_alphabet <= 'Z'; icap_alphabet++)
{
if ((cap_alphabet == c) || (icap_alphabet == c))
{
return (1);
}
}
}
return (0);
}