please find error in my code if any an give me output

#include<iostream>
#include<stdio.h>
using namespace std;
int main(){
char str[100];
int i =0; int check = 0;
gets(str);
while(check==i)
{while(str[i]!=' ' || str[i]!='\0')
{i++;}
for(int j=i-1;j>=check;j--){
cout<<str[j]; }
if(str[i]==' ')
{check=i;
cout<<str[i];
}
else{check=-1;}}
return 0;}



please give output if string entered is "AB IS GOOD BOY"
Topic archived. No new replies allowed.