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 1st semester Object Oriented Programming

Advertisement Banner
Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-03-2011, 02:25 PM
bonfire's Avatar
M.Arsalan Qureshi

 

Join Date: Oct 2008
Location: Garden Town, Multan Cantt
Posts: 630
Thanks: 238
Thanked 238 Times in 147 Posts
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
Time Spent Online: 4 Days 15 Hours 26 Minutes 57 Seconds
Default Program to enter your age and print if you should be in grade 10


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

void main()
{
clrscr();
int age;
cout << "Enter your present age : " << endl;
cin>>age;
if(age==16)
{
cout << "Your present age is " << age << " years." << endl;
cout << "You are of the right age for joining grade 10 !" << endl;
}
else
{
cout << "Your present age is " << age << " years." << endl;
cout << "You are not of the right age for joining grade 10 !" << endl;
}
getch();
}
This program takes in the age as a screen input from the user.
The program tells the user whether he/she should be in grade 10 or not by using the 'IF-ELSE' command.
It then prints out the appropriate message using the 'cout' command.
SAMPLE INPUT
15

SAMPLE OUTPUT
Your present age is 15 years.
You are not of the right age for joining grade 10 !
__________________

Reply With Quote
Top 10 Lists | Live Cricket Score

Reply

Tags
age, enter, grade, print, program


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
Program to enter an integer and print if it is prime or composite bonfire Object Oriented Programming 1 22-11-2011 07:45 PM
Program to enter two integers and print the quotient and remainder bonfire Object Oriented Programming 0 01-03-2011 03:06 PM
Program to enter an integer and print out its successor bonfire Object Oriented Programming 0 01-03-2011 02:55 PM
Program to enter an integer and print if it is greater or less than 100 bonfire Object Oriented Programming 0 01-03-2011 02:28 PM

Best view in Firefox
Free File Hosting | Webmaster Forum | 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 - 2012, Jelsoft Enterprises Ltd.