Your SlideShare is downloading. ×
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Pratik Bakane C++
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Pratik Bakane C++

148

Published on

Pratik Bakane C++ programs...............This are programs desingedby sy diploma student from Governement Polytecnic Thane.....programsare very easy alongwith coding andscreen shot of the output

Pratik Bakane C++ programs...............This are programs desingedby sy diploma student from Governement Polytecnic Thane.....programsare very easy alongwith coding andscreen shot of the output

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
148
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. #include<iostream.h> #include<conio.h> class control { public: control() { calculate(); cout<<endl<<"nnttConstructor"; } void calculate() { display(); cout<<"nnttCalculator"; } void display() { cout<<endl<<"nnttDisplayed"; } };
  • 2. void main() { clrscr(); control c1; getch(); } OUTPUT:
  • 3. #include<iostream.h> #include<conio.h> class book { char publication[20]; float price; }bk; int main() { clrscr(); cout<<"nntt"<<sizeof(book)<<"nntt"<<sizeof(bk); getch(); }
  • 4. OUTPUT:
  • 5. /* Program to declare a class journal having data members as journal_nm,price,issn_no. Accept this data for two objects and display the journal having greater price */ #include<iostream.h> #include<conio.h> class journal { public: char name[20]; int issn_no,price; public: void accept() { cout<<"nnttEnter the Journal Name : "; cin>>name; cout<<"nnttEnter the ISSN number : "; cin>>issn_no; cout<<"nnttEnter the Price : "; cin>>price;
  • 6. } void display() { cout<<"nnttName of Journal having gretaer price is : "<<name; } }; void main() { int i; clrscr(); journal j[2]; for(i=0;i<2;i++) { j[i].accept(); } if(j[0].price>j[1].price) { j[0].display(); } else {
  • 7. j[1].display(); } getch(); } OUTPUT:
  • 8. /Program to declare a class “Day” having data members as hours,min,sec.Accept min from user convert in appropriate hours,min,sec.Display it for one object of class./ #include<iostream.h> #include<conio.h> class Day { private: int hours,min, sec; public: void accept() { cout<<"nnttEnter minutes : "; cin>>min; hours = min/60; cout<<"nntthour : "<<hours<<endl; min = min-(hours*60); cout<<"nnttmin : "<<min<<endl; sec=30; cout<<"nnttsec : "<<sec<<endl;
  • 9. } }; void main() { clrscr(); Day d; d.accept(); getch(); }
  • 10. OUTPUT:

×