TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
User-Defind C++ Program with Class Constractor
Krishna Rajput Singh
Feb 25
2016
Code
730
0
1
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
#include<iostream>
//#include<stdafx.h>
class
Contructor
{
char
chr;
public
:
void
acceptnumber()
{
cout<<
"Enter a charcter:"
;
cin>>chr;
if
(chr==
'A'
)
cout<<
"the charcter is A"
;
else
cout<<
"the charactor is not A"
;
}
};
int
main()
{
Contructor C1;
C1.acceptnumber();
return
0;
}
C++
Class Constractor