0

why do i get compilation errors in this code?

#include <iostream> #include <string> using namespace std.   int main(){     char c;     cout<< "Enter a Character: ")";     cin>> c;     /* Check if input alphabet is member of set{A,E,I,O,U,a,e,i,o,u} */     if(c == 'a' || c == 'e' || c =='i' || c=='o' || c=='u' || c=='A'           || c=='E' || c=='I' || c=='O' || c=='U'){         cout<< c<<" is a Vowel\n";     } else {         cout<< c<<" is a Consonant\n", c);     }          return 0; }

4th Jan 2017, 2:19 PM
Syed Naqvi
Syed Naqvi - avatar
14 Respuestas
+ 16
")"
4th Jan 2017, 2:20 PM
Frost
Frost - avatar
+ 16
using namespace std;
4th Jan 2017, 2:33 PM
Frost
Frost - avatar
+ 15
c);
4th Jan 2017, 2:21 PM
Frost
Frost - avatar
+ 10
We all said the same! ^_^
4th Jan 2017, 2:34 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 9
in the end of "using namespace std" you put "." (period) replace with ";" (semicolon).
4th Jan 2017, 2:31 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 8
Yes, remove that : ")".
4th Jan 2017, 2:22 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 7
I did copy-paste but i can't find error (try converting input immediately to char on input)
4th Jan 2017, 2:46 PM
Valen.H. ~
Valen.H. ~ - avatar
+ 3
#include <iostream> #include <string> using namespace std.   int main(){     char c;     cout<< "Enter a Character: ";     cin>> c;     /* Check if input alphabet is member of set{A,E,I,O,U,a,e,i,o,u} */     if(c == 'a' || c == 'e' || c =='i' || c=='o' || c=='u' || c=='A'           || c=='E' || c=='I' || c=='O' || c=='U'){         cout<< c<<" is a Vowel";     } else {         cout<< c<<" is a Consonant";     }          return 0; }
4th Jan 2017, 2:26 PM
Syed Naqvi
Syed Naqvi - avatar
+ 2
guys I did evrythng and even for the new code I get errors....:(
4th Jan 2017, 2:26 PM
Syed Naqvi
Syed Naqvi - avatar
+ 2
You don't need #include <string> c is a char
4th Jan 2017, 3:13 PM
Konstantinos Kritharidis
Konstantinos Kritharidis - avatar
+ 1
well guys...it didn't work either...I suggest you all to copy paste this code and find it urselves....please tell if it works...dang.#include <iostream> #include <string> using namespace std;   int main(){     char c;     cin>> c;     /* Check if input alphabet is member of set{A,E,I,O,U,a,e,i,o,u} */     if(c == 'a' || c == 'e' || c =='i' || c=='o' || c=='u' || c=='A'           || c=='E' || c=='I' || c=='O' || c=='U'){         cout<< c<<" is a Vowel";     } else {         cout<< c<<" is a Consonant";     }          return 0; }
4th Jan 2017, 2:44 PM
Syed Naqvi
Syed Naqvi - avatar
+ 1
(I copy/pasted your code) if you comment out code after cin, you'll be able to see the error compiler throws - stray '\320' and '\204' (I think) at the beginning of all your indented lines what app are you writing your code in?
10th Jan 2017, 5:42 AM
Renata