- 7
Anybody please send me the code for the challenge camel to snake in c
Challenge: camel string case into snake case
4 odpowiedzi
+ 7
Arsh Abbas ,
we will not send you a ready-made code for this code coach exercise.
but we may help you, if you show us the attempt you have don, also give us a description about the issues you are faced with.
+ 1
#include<stdio.h>
#include<string.h>
#include<ctype.h>
void main(){
char input[50];
int i,j,index;
scanf("%[^\n]",input);
for(i = 0;i < strlen(input);i++){
for(j = 65;j <= 90;j++){
if(input[i] == (char)j){
input[i] = tolower(input[i]);
index = i;
for(i = strlen(input);i >= index; i--){
input[i+1] = input[i];
}
input[index] = '_';
break;
}
}
}
puts(input);
}
0
All test cases passed except last one.
0
Please Check for any bug in my code.