#include
using namespace std;
#include
#include
int main() {
char a[1000];
int i;
for(i=0;i<a.size();i++)
cin>>a[i];
for(i=0;i<a.size();i++)
{
if(a[i]>=‘A’&&a[i]<=‘Z’)
{
cout<<endl;
}
cout<<a[i];
}
return 0;
}
#include
using namespace std;
#include
#include
int main() {
char a[1000];
int i;
for(i=0;i<a.size();i++)
cin>>a[i];
for(i=0;i<a.size();i++)
{
if(a[i]>=‘A’&&a[i]<=‘Z’)
{
cout<<endl;
}
cout<<a[i];
}
return 0;
}
if(a[i]>=’ A’ && a[i]<=‘Z’){
print(a[i])// u also have to cout this upper case character
cout<<endl
}
but error is in something else
#include using namespace std; #include #include int main() { char a[1000]; int i; for(i=0;i<a.size();i++) cin>>a[i]; for(i=0;i<a.size();i++) { if(a[i]>=‘A’&&a[i]<=‘Z’) { cout<<endl; cout<<a[i]; } cout<<a[i]; } return 0; }
anshul
save your code to online ide of coding block and then post the link here
it is hard to debug like that
ab to btado…
what is a.size() in for loop
to iterate it to the last
U have not taken any input in the array before the for loop so how can u use a.size
It will have a garbage value
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.