New Member FAQ
|
Forums
|
Earn Revenue
Resources
Entrance
Ask Experts
Exam Papers
Jobs
English
Projects
Universities
Colleges
Courses
Schools
Training
My India
Members
|
Communities
|
Business Directory
|
Classifieds
|
Reviews
|
Silverlight Games
|
Peer Appraisal
|
Bookmarks
|
Polls
|
Mentors
|
Links
|
B.Tech Projects
|
Lobby
|
Gift Shop
|
Chat
My Profile
Sign In
Register
AdSense Revenue
Active Members
Today
PROSENJIT MANN...
(847)
Mr. Anindya
(453)
ashish
(422)
Last 7 Days
PROSENJIT MANN...
(1961)
Shobha Manasa
(1774)
Lenin
(1522)
more...
Awards & Gifts
Online Exams
Aptitude Questions
General Aptitude Tests
Medical Entrance
Engineering Entrance
Bank Tests
TOEFL & IELTS Questions
Fresher Jobs
Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi
Resources
Find educational articles, blogs, discussion threads and other resources.
Colleges
Find details about any college in India or search for courses.
Project to find out the roll number of the student using c++
Posted Date: Total Responses:
0
Posted By:
shafreen zeba
Member Level:
Silver
Points/Cash
: 2
#include
#include
class student//CLASS SPECIFICATION
{
double r; //DECLARATION OF PRIVATE DATA MEMBERS
char name[30];
public:
void set();//DECLARATION OF PUBLIC MEMBER FUNCTIONS
void print()const;//DECLARATION OF PUBLIC CONSTANT MEMBER FUNCTIONS
};
void student::set()//FUNCTION DEFENITION OUTSIDE THE CLASS SPECIFICATION
{
cout<<"\nEnter the roll no.";
cin>>r;
cout<<"\nEnter the name:";
cin>>name;
}
void student::print()const//FUNCTION DECLARATION OUTSIDE THE CLASS SPECIFICATION
{
cout<<"\nName of the student is"<
cout<<"\nRoll number of the student is"<
}
void main()
{
student s;//CREATING AN OBJECT
clrscr();
cout<<"\n\n\t\tPROGRAM FOR CLASS WITH CONSTANT MEMBER FUNCTION";
s.set();//INVOKING PUBLIC MEMBER FUNCTION BY THE OBJECT
s.print();//INVOKING PUBLIC MEMBER FUNCTION BY THE OBJECT
getch();
}
Output:
Enter the roll number : 1508850
Enter the student name : Chris Fletcher
Name of the student is Chris Fletcher
Roll number of the student is 1508850
Project Feedbacks
No feedbacks found. Be the first to respond and make money from
revenue sharing program
.
Post Feedback
You must
Sign In
to post a feedback.
Next Project:
project to calculate tax using c++
Previous Project:
Project to calculate array size using java
Return to Project Index
Post New Project
Related Projects
Calculator
Unix
AbstractCustomTableModel using javax.swing
Routing Simulator
Tree Collection Proxy in C Sharp
Advertise Here
Contact Us
Advertise
Editors
Privacy Policy
Terms Of Use
ISC Technologies.
2006 - 2009 All Rights Reserved.