HOME BZU Mail Box Online Games Radio and TV Live Cricket Score All Albums
Go Back   BZU PAGES: Find Presentations, Reports, Student's Assignments and Daily Discussion; Bahauddin Zakariya University Multan Institute of Computing Bachelor of Science in Information Technology BsIT 2nd Semester Object Oriented Programming


Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 09-03-2011, 12:11 AM
bonfire's Avatar
M.Arsalan Qureshi

 

Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 616
Program / Discipline: BSTS
Class Roll Number: 09-31
bonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond reputebonfire has a reputation beyond repute
Default Program to identify if an input is a symbol, digit or character


Program to identify if an input is a symbol, digit or character


#include <iostream.h>
#include <conio.h>

void main()
{
clrscr();
char charac;
cout << "Enter your input : " << endl;
cin>>charac;
if(((charac>='A')&&(charac<='Z'))||((charac>='a')& &(charac<='z')))
cout << "Your input " << charac << " is a character." << endl;
else if((charac>='0')&&(charac<='9'))
cout << "Your input " << charac << " is a digit." << endl;
else
cout << "Your input " << charac << " is a symbol." << endl;
getch();
}
This program takes in a character, a digit or a symbol charac as a screen input from the user.
It then identifies whether the input is a symbol, a digit or a character and outputs the appropriate message using the 'cout' command.
Sample Input
#
Sample Output
Your input # is a symbol.
__________________

Reply With Quote
Reply

Tags
character, digit, identify, input, program, symbol


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
A Program to find a greater digit in a four digit number. JuNaiDiQbaL Object Oriented Programming 0 08-05-2011 11:12 PM
Program to enter a character and output its ASCII code bonfire Object Oriented Programming 0 09-03-2011 12:14 AM
Program to convert 2-digit octal number into binary number and print it bonfire Object Oriented Programming 0 09-03-2011 12:03 AM
Program to output an integer, a floating point number and a character bonfire Object Oriented Programming 0 28-02-2011 10:39 PM
write a program to input visiting and perment employee record by insertion extertion arslanbadar BsCS 3rd Semester 0 06-11-2008 07:25 PM

Best view in Firefox
Almuslimeen.info | Cloud Computing | Dedicated server hosting
Note: All trademarks and copyrights held by respective owners. We will take action against any copyright violation if it is proved to us.

All times are GMT +5. The time now is 10:20 PM.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish.