I have written the code but it is not working please check

hello @satyamsingla
you are not taking input properly.
please refer this simple code and modify ur code accordingly
#include<bits/stdc++.h>
using namespace std;
int main(){
string s;
cin>>s;
int i=0;
while(s[i]){
cout<<s[i];
i++;
}

}

in the video the same code is written using character not string. so chck the video and then my code and then tell me error.

@satyamsingla
pls tell me the video name

programming fundamentals 2-shortest path string

check ur updated code here ->https://ide.codingblocks.com/s/232792

a) i have added ch=cin.get() in line 31.
b) condition in while loop should be while(ch!= ‘\n’ )

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.