Skip to main content

Posts

Showing posts with the label c programs

10 Reasons why you should learn 'C'

1) C is lower level then other programming languages (C++, Java). Programming at a lower level allows you to further your understanding of computers, as a whole. 2) Device drivers and operating systems are written exclusively in C. Now, you may never write a device driver or an operating system, but what if you are ever required to modify one? (......) 3) What if you ever want to get a job programming micro controllers? They are programmed in C. Are you going to limit your possible list of jobs because you didn't want to learn a new language? 4) C programs are smaller and faster then any other program created in a different language. Sometimes your program needs that speed boost that only C can give it. 5) If you have learned C, you can learn any modern programming language. The reason behind this is that all modern programming languages are based on C (Java, C++, C#, etc). 6) Because C has been around for many years, it has a large community and col

$$$CLASS FOR LIBRARY IN C $$$

Class for Library # include # include // Creating a basic template for book and magazine class lib { private: char title[20]; char pub[20]; unsigned int acc_no; public: //method for getting inputs void get_details() { cout<<"Enter the book title"< >title; cout<<"Enter the publisher name"< >pub; cout<<"Enter the accession number"< >acc_no; } //method for showing output void show_details() { cout<<"Title : "< >author; } void show_details() { lib::show_details(); cout<<"Autohr : "< >editor; } void show_details() { lib::show_details(); cout<<"editor : "< } }; void main(void) { clrscr(); //creating objects book b; magz m; b.get_details(); m.get_details(); b.show_details(); m.show_details(); getch(); }