Computer Science, asked by Anonymous, 1 year ago

/*A MENU driven Program*/
#include<iostream.h>
#include<conio.h>
#include<process.h>
void main()
{
clrscr();
char ch;
int i;
cout<<"\t\t\t\tMENU";
cout<<"\n\t\t\t\t----";
cout<<"\n1. To display ASCII Code of a character.";
cout<<"\n2. To display the character by entering its ASCII code.";
cout<<"\n3. To Exit.";
cout<<"\nEnter your Choice(1-3) : ";
cin>>ch;

switch(ch)
{
/*To Display the ASCII code of a character*/
case '1':
cout<<"\nEnter a character : ";
cin>>ch;

cout<<"\nASCII value of "< cout<<""< break;
///////////////////////////////
/*To Diplay the character by Entering it's ASCII code*/
case '2':
cout<<"\nEnter ASCII code : ";
cin>>i;

cout<<"\nThe Character of "< cout<<""< break;
///////////////////////////////

case '3':
exit(0);
break;
///////////////////////////////

default:
cout<<"\nInvalid Number";
cout<<""< break;
///////////////////////////////
}
getch();
}

What is the output of the PROGRAM?

Answers

Answered by snigdhbhardwaj
1
If no input is given, as in case here
Output is:

MENU
----
1. To display ASCII Code of a character.
2. To display the character by entering its ASCII code.
3. To Exit.
Enter your Choice(1-3) :

As you have not given any input in question, so the output ends here.

snigdhbhardwaj: Actually in first two lines there 4*tabs spaces in beginning but it removed from my answer
Similar questions