-
Notifications
You must be signed in to change notification settings - Fork 0
/
0-main.c
52 lines (48 loc) · 921 Bytes
/
0-main.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#include <stdio.h>
#include "function_pointers.h"
/**
* print_name_as_is - prints a name as is
* @name: name of the person
*
* Return: Nothing.
*/
void print_name_as_is(char *name)
{
printf("Hello, my name is %s\n", name);
}
/**
* print_name_uppercase - print a name in uppercase
* @name: name of the person
*
* Return: Nothing.
*/
void print_name_uppercase(char *name)
{
unsigned int i;
printf("Hello, my uppercase name is ");
i = 0;
while (name[i])
{
if (name[i] >= 'a' && name[i] <= 'z')
{
putchar(name[i] + 'A' - 'a');
}
else
{
putchar(name[i]);
}
i++;
}
}
/**
* main - check the code for Holberton School students.
*
* Return: Always 0.
*/
int main(void)
{
print_name("Danton", print_name_as_is);
print_name("Rick Harris", print_name_uppercase);
printf("\n");
return (0);
}