Skip to main content

AD

The following program reads the letter from A to Z and prints it's corresponding telephone digit. This program uses a sentinal controlled while loop . To stop the program user is promoted for the sentinal which is # .

 The following program reads the letter from A to Z and prints it's corresponding telephone digit. This program uses a sentinal controlled while loop . To stop the program user is promoted for the sentinal which is # .


SOURCE  CODE :-

#include <iostream> 
using namespace std; 
int main() 
char letter ;
cout << "This is a program to convert uppercase Letter from A to Z into their corresponding telephone digit " << endl ;
cout << "To stop this program enter # " << endl ;
cout << "Enter an uppercase letter : " << endl ;
cin >> letter ;
while (letter != '#' )
{
cout << "The letter you entered is " << letter << " and the corresponding telephone digit is : " << endl ;
if (letter >= 'A' && letter <= 'Z' )
{
switch (letter)
{
case 'A' :
case 'B' :
case 'C' :
cout << "2" << endl ;
break ;
case 'D' :
case 'E' :
case 'F' :
cout << "3" << endl ;
break ;
case 'G' :
case 'H' :
case 'I' :
cout << "4" << endl ;
break ;
case 'J' :
case 'K' :
case 'L' :
cout << "5" << endl ;
break ;
case 'M' :
case 'N' :
case 'O' :
cout << "6" << endl ;
break ;
case 'P' :
case 'Q' :
case 'R' :
case 'S' :
cout << "7" << endl ;
break ;
case 'T' :
case 'U' :
case 'V' :
cout << "8" << endl ;
break ;
case 'W' :
case 'X' :
case 'Y' :
case 'Z' :
cout << "9" << endl ;
break ;
}
}
else
cout << "Invalid input "<< endl ;
cout << "Enter another uppercase letter to find it's corresponding telephone digit, To stop the program please enter '#' " << endl ;
cin >> letter ;
cout << endl ;
}
return 0 ;
}

Follow us for more posts like this ........

Comments

Popular posts from this blog

How to make age calculator tool website on blogger

How to make age calculator tool website on blogger How to make age calculator on  Blogger Website . We will know all these things in this article related to  make age calculator . Nowadays  blogging  is at one level only. So in such a situation there are different departments in the blogging sector. So, one of the best is tool website. Many of my subscribers have asked me in the comment that  how can we make age calculator tool websiteon Blogger / Blogspot Platform? Your age calculator looks like this .... Let me tell you clearly that a different trend of  Age Calculator  is going on. So in such a situation, everyone wants to have their own age calculator tool. So in such a situation, I have explained in detail in this post how you can easily make age calculation tool. What is Age Calculator Tool? There are many new bloggers who have just entered the field of blogging. Which are they to do something new in this blogging industry? So in such a situ...

1st Year Chemistry Short Questions (Chapter 10)

 If you are in 1st year class And searching for important short questions for your exams preparation than read it out  Here is some short questions from chapter 10 of 1st year INTRODUCTION   1. Define electrochemistry? 2. Differentiate oxidation & réduction  3. Explain the difference b/w electrolytic cell & voltic cell,  OXIDATION STATE  4. Write four rules used to assign oxidation state of element. 5. What is oxidation no. of hydrogen & oxygen in their compounds? 6. Calculate oxidation no. of Cl in Ca(CIO3)2, NaCI, KCI & KClO3 7. Calculate oxidation no. of Cr in Cr2(SO4)3& Cr2O7^-2 8. What is oxidation no.? Determine Oxidation No. of P in H3PO4 9. Calculate the oxidation no. of S in SO4^2-& Mn in KMnO4  ELECTROLYTIC CONDUCTION & ELECTROLYTIC CELL   10. What is difference b/w metallic and electrolytic conduction?  11. Define electrolysis and ionization. 12. Describe the electrolysis of molten sodium chloride. ...

How to download any movie from website for free

 Assalam u Alaikum ! I hope all of you are fine and enjoying your life happily . You are reading TN WRITES . In today post I am going to tell you how you can download any movie using filmymeet website which is a free website . Here is Step by Step process :- 1)- Open your Google Chrome or any other browser which you use in your daily life .....  Currently , I am using Google Chrome browser ... 2)-Search in search bar  "Filmymeet"  3)-Open first website .... "Filmymeet"  If you can't find this website than don't worry just click on the following name of website Filmymeet You will directly goes to the home page of website . 4)-Here is the homepage of filmymeet  5)-If you get your movie on homepage it's good but if you don't get your required movie than just scroll down and find search bar which is nearly at the bottom of page ..... And search your desired movie with it's correct name  For example , If I want to download IRON MAN Movie than I have t...