Skip to Main Content
Fundamentals of Computer Programming and IT by Pearson
book

Fundamentals of Computer Programming and IT by Pearson

by Ashok Namdev Kamthane, Rohit Khurana
May 2024
Intermediate to advanced content levelIntermediate to advanced
577 pages
22h 34m
English
Pearson India
Content preview from Fundamentals of Computer Programming and IT by Pearson
556 Solved Question Papers
{
cout<<”Enter Feet”;
cin>>feet;
cout<<”Enter Inches”;
cin>>inch;
}
void display()
{
cout<<feet<<” ”<<inch;
}
void operator ++()
{
feet++;
inch++;
}
} ;
void main()
{
distance d;
d.getdata();
cout<<”Before :” ;
d.display();
d⫹⫹ ;
cout<<”After :”;
d.display();
}
Output:
Enter Feet 10
Enter Inches 10
Before
10 10
After
11 11
A program to add two distance objects using operator:
#include<conio.h>
#include<iostream.h>
class distance
{
int feet, inch;
public:
void getdata()
{
cout<<”Enter Feet”;
cin>>feet;
cout<<”Enter Inches”;
cin>>inch;
}
Q001-Kamthane-021101_Q & A.indd 556Q001-Kamthane-021101_Q & A.indd 556 7/29/2011 3:37:16 PM7/29/2011 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Basic Computer Engineering (Subject Code: BE - 205)  by Pearson

Basic Computer Engineering (Subject Code: BE - 205) by Pearson

Anita Goel, Anand Motwani

Publisher Resources

ISBN: 9781299447479