| 4 | #include <stdlib.h> |
| 5 | |
| 6 | void myFunction(char s[]) //Function defined |
| 7 | { |
| 8 | for(int i=0;i<strlen(s);i++) //looping: from 0 to the (length of string-1) |
| 9 | { |
| 10 | if (i%2 == 0) //if i is divisible by 2 |
| 11 | { |
| 12 | printf("%c",s[i]); //print the letter in the ith position |
| 13 | } |
| 14 | } |
| 15 | |
| 16 | printf(" "); //printing a little space |
| 17 | |
| 18 | for(int i=0;i<strlen(s);i++) //looping: from 0 to the (length of string-1) |
| 19 | { |
| 20 | if (i%2 != 0) //if i is not divisible by 2 |
| 21 | { |
| 22 | printf("%c",s[i]); //print the letter in the ith position |
| 23 | } |
| 24 | } |
| 25 | |
| 26 | printf("\n"); //start from the next line for the next test case. |
| 27 | |
| 28 | } |
| 29 | |
| 30 | int main() |
| 31 | { |