MCPcopy Create free account
hub / github.com/Vishruth-S/CompetitiveCode / myFunction

Function myFunction

Hackerrank_problems/Let's Review/solution.C:6–28  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4#include <stdlib.h>
5
6void 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
30int main()
31{

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected