Chapter 4:
Input And Output
Programming Exercise
Problem # 21:
Write a program to enter a letter and display the next two letters.
Solution:
#include<iostream>
#include<conio.h>
using namespace std;
int main()
{
char ch;
cout<<"Enter a character : ";
cin>>ch;
cout<<"Next two characters : ";
ch++;
cout<<ch<<"\t";
ch++;
cout<<ch<<"\t";
return 0;
}
#include<conio.h>
using namespace std;
int main()
{
char ch;
cout<<"Enter a character : ";
cin>>ch;
cout<<"Next two characters : ";
ch++;
cout<<ch<<"\t";
ch++;
cout<<ch<<"\t";
return 0;
}
Output:
Let me know in the comment section if you have any question.Previous Post:
20. Program that reads a positive number and then computes the logarithm of that value to the base 2.
Sir you should also give inpit of programs..
ReplyDeleteOkay, I will try to upload output screen of every program. Screenshot for this one is added. Please share this blog if you find it helpful.
Deletenice
ReplyDelete