Sample – Program to enter a letter and output the next 2 letters.
by Nideesh C on February 8, 2011 · 0 comments
in C++
#include <iostream.h>
#include <conio.h>
void main()
{
clrscr();
char charac;
cout << “Enter your letter : ” << endl;
cin>>charac;
cout << “The 2 letters are : ” << endl;
cout << (char)(charac-1) << endl;
cout << (char)(charac+1) << endl;
getch();
}
This program takes in a letter charac of the English alphabet as a screen input from the user.
It then determines its previous letter and next letter and prints it out using the ‘cout’ command.
Not Satisfied ? Just search & get the result
Related posts:
- Sample – Program to identify if an input is a symbol, digit or character.
- Sample – Program to enter an integer and output it in the reversed form.
- Sample – Program to enter salary and output income tax and net salary.
- Sample – Program to enter an integer and output its 15 multiples.
- Sample – Program to enter a string and find its length.
Tagged as:
c programming examples,
c programming reference,
c tutorial,
c++ program examples,
C++ Programming,
learning c++,
Program to enter a letter and output the next 2 letters.,
programming languages,
programming languages c,
sample c++ programs
Me, freelance system administrator having the qualification of Diploma in Electronics & Tele-communication + MCSE + CCNA + CST + 5 years of experience in IT field.
If you like This post, you can follow TheOnlineTutorials on Twitter.
Contact me Via email: support@theonlinetutorials.com
Subscribe to feed via Feed or EMAIL to receive instant updates.
Legal Disclaimer:All information found on the site is without any implied warranty of fitness for any purpose or use whatsoever. Content author/site administrator is not responsible for any loss occurred due to mistakes in this tutorial. Use this tutorial website at your own risk.