i'm not sure if you're supposed to be using files or not, but here you go. you can edit it if you are #include **** #include **** #include **** #include **** using namespace std; int main () { int i=0; char a[50]; char c; cin.getline(a,50); while (a[i]) { c=a[i]; putchar (toupper(c)); i++; } system("PAUSE"); return 0; }
I haven't worked with C++ for a while so I'm kind of rusty on the syntax. int main(){ char a[50]; //Assuming 50 is max length f.getline(a,50); int length = strlen(a); for(int i=0; i= 'a' && a[i]<='z' ? a[i]-32 : a[i]; cout<
using namespace std; ifstream f("atestat.in"); ofstream g("atestat.out"); int main() {unsigned int n,i,val=32; char a[50]; f.getline(a,50); n=strlen(a); //a if(a[1]>='a' && a[1]<='z') cout<<a[1]-val; else cout<<a[1]; for(i=2;i<=strlen(a);i++) if((isalpha(a[i-1])==0)&& isalpha(a[i])==1) cout<
I remember doing this in Java but I don't feel like digging through those files.
I'm confused. You should have the commands you need to input a word and receive the desired capitalization. Just find out the code you need to output and work from there.
that mistake occurred due to skype c/p (a) = angel
it takes like 1 minute I think I can't see it...and I wanted to say strlen(a)
jWizard What is strlen(angel)?? You don't have an angel variable. The process of converting each letter should be done in a loop. I don't know why you commented out the if statement under strlen(angel). Your bottom for loop doesn't have an opening bracket so nothing gets looped. Hey could you please c/p the algorithm and correct the mistake?
This would be a good topic for Gary.
What is strlen(angel)?? You don't have an angel variable. The process of converting each letter should be done in a loop. I don't know why you commented out the if statement under strlen(angel). Your bottom for loop doesn't have an opening bracket so nothing gets looped.
for example if my string is dog Cat *roughness the output => Dog Cat *Roughness
Can you provide example input/output of your program?
I need to change the lower case to upper case basically