Could you please tell me why i am getting errors..i think my code should work..please mention in comments // where i am doing wrong and please correct my code

question:
can you read this( Coding Blocks)

answer:

You were taking the input as char array and passing it as a string, that was the issue and there was little error in the logic as well.
I’ve made some changes in your code, you can check it out here.

you have not send the code

ok i got the code…but please explain me why you are checking the condition a!=0…

I’m trying to print a newline before every Capital character, except for the case where the capital character is present on the 0th index.
Otherwise the answer would be:
// empty line
I
Am
A
Competitive
Programmer
Just to omit the first empty line I’m using the condition i!=0.
Hope this helps.