Computer Science, asked by misscutie94, 5 months ago

➡️ Computer C++
Rectify the errors (if any) and re-write the correct program given below :-
//Program to input a character in lower case and print whether it is a space or vowel or a $ sign.
#include<iostream.h> #include<conio.h>
void main()
{
int ch;
clrscr();
cout<<"Enter any character"<<endl
cin>>ch;
if(ch==' ') cout<<ch<<ls a blank space;
elseif (ch=='$')
cout<<ch<<"ls a Dollar sign";
elseif (ch=='a'||ch=='e'||ch='"'||ch=='o'l|ch=='u')
cout<<ch<<" Is a Vowel";
getch();
}
➡️ Wrong Answer will be reported​

Answers

Answered by Vyomsingh
54

GIVEN:

  • Program to input a character in lower case and print whether it is a space or vowel or a $ sign.

____________________________

What to Do?

  • Rectify the errors (if any)
  • Re-write the correct program

____________________________

Correct Code→

#include<iostream.h>

#include<conio.h>

void main()

{

int ch;

clrscr();

cout<<"Enter any character"<<endl;

cin>>ch;

if(ch==' ')

cout<<ch<<"ls a blank space";

else if (ch=='$')

cout<<ch<<"ls a Dollar sign";

else if (ch=='a'||ch=='e'||ch='i'||ch=='o'||ch=='u')

cout<<ch<<" Is a Vowel";

getch();

}

______________________________

POINT:-

Errors in the given Program is corrected now and Where there were errors , are shown by UNDERLINE.

Similar questions