We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 901f09b commit 9c1bbfaCopy full SHA for 9c1bbfa
0x06-pointers_arrays_strings/100-rot13.c
@@ -0,0 +1,34 @@
1
+#include "main.h"
2
+#include <stdio.h>
3
+
4
+/**
5
+ * rot13 - encoder rot13
6
+ *
7
+ * @s: pointer to string params
8
9
+ * Return: *s
10
+ */
11
12
+char *rot13(char *s)
13
+{
14
+ int a = 0;
15
16
+ while (s[a])
17
+ {
18
+ while ((s[a] >= 'a' && s[a] <= 'z') || (s[a] >= 'A' && s[a] <= 'Z'))
19
20
+ if ((s[a] > 'm' && s[a] <= 'z') || (s[a] > 'M' && s[a] <= 'Z'))
21
22
+ s[a] -= 13;
23
+ break;
24
+ }
25
26
+ s[a] += 13;
27
28
29
30
+ a++;
31
32
33
+ return (s);
34
+}
0 commit comments