computer hardware - wordpress.com€¦  · web viewto begin, open microsoft word by choosing...

180
INDEX Sr. No, Topic Remarks 1. Introduction to Computer Hardware 2. Installation Of Windows XP 3. Control Panel 4. Practice with MS Word 5. WAP to find whether a no. is palindrome or not 6. WAP to print the series- 2,4,6…………..20 terms 7. WAP to check whether a no. is greater than 200 or not 8. WAP to enter a no. and enter no. of spaces and then display it 9. WAP to enter a day no. and display the respective day 10. Write a small library program to show the use of function 11. WAP to enter marks of student and display all information using structures 12. WAP to enter employee’s data and display it in a systematic manner 13. WAP to create a structure student to enter students data and display results 14. WAP using structures to get students marks, calculate %age and then display their grades 15. WAP to enter a value and transfer the incremented value to a new variable and display it 16. WAP to show use of array by displaying input and output 17. WAP to input elements and then find the position of a specific 1

Upload: others

Post on 02-Jun-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

INDEX

Sr. No, Topic Remarks

1. Introduction to Computer Hardware2. Installation Of Windows XP3. Control Panel4. Practice with MS Word5. WAP to find whether a no. is palindrome or not6. WAP to print the series- 2,4,6…………..20 terms7. WAP to check whether a no. is greater than 200 or

not8. WAP to enter a no. and enter no. of spaces and then

display it9. WAP to enter a day no. and display the respective

day10. Write a small library program to show the use of

function11. WAP to enter marks of student and display all

information using structures12. WAP to enter employee’s data and display it in a

systematic manner 13. WAP to create a structure student to enter students

data and display results14. WAP using structures to get students marks,

calculate %age and then display their grades15. WAP to enter a value and transfer the incremented

value to a new variable and display it16. WAP to show use of array by displaying input and

output17. WAP to input elements and then find the position

of a specific element18. WAP to find whether a no. is prime or not19. WAP to find greatest of three no’s.20. WAP to calculate simple interest21. WAP to conduct multiple functions of

multiplication and addition22. WAP to calculate area and circumference of a

circle23. WAP to find biggest element of the array24. WAP to print fibonicci series25. WAP to check whether license can be issued to the

user or not26. WAP to print quotient and remainder27. WAP to find the day respective to the given day no.

1

Page 2: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

28. WAP to display results of students in a systematic form using setw command

29. WAP to add 2 no’s using function30. WAP to enter no’s using array and find the position

of a specific no.31. WAP that finds area of rectangle circle and triangle

according to user’s requirement32. WAP that finds square, cube and fifth power of a

no.33. WAP to check whether a string is palindrome or

not34. WAP to input a matrix and display it35. WAP to add two matrices and display the result36. WAP to find transpose of a matrix37. WAP to multiply two matrices38. WAP to print AMRITSAR39. WAP to find average of n no’s.40. WAP to find smallest element in an array41. WAP to subtract two matrices42. WAP to find sum of diagonal elements of a matrix43. WAP to find vowels in a given string44. WAP to explain the concept of return statement

without condition45. WAP to explain the concept of return statement

with condition46. WAP to find factorial of a no. using recursion47. WAP to print fibbonicci series using recursion48. WAP to convert Celsius temperature into

Fahrenheit49. WAP to read the values of w,x,y,z and display the

value of p where p=w+x/y-z.

50. WAP to calculate area of circle, rectangle, triangle

depending upon user’s choice.

51. WAP to compute cosine series i.e cos(x)=1-x2/2!-

x4/4!-x6/6!+……xn/n!.

52. WAP to swap two numbers using function.

53. WAP that uses a function to sum n natural numbers

starting from a given number.

54. WAP to multiply two numbers to explain the

concept of prototype.

2

Page 3: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

55. WAP to print multiplication table of a no.

56. WAP to print 12 as

1

2

57. W.A.P to print

*

**

***

****

*****

58. WAP to print

1

12

123

1234

59. WAP to print

1

22

333

4444

55555

60. WAP to find average of n numbers using while

loop.

61. WAP to display even numbers between 1 to 15.

62. WAP to check whether a given number is

palindrome or not.

63. Write a program to illustrate the use of pointer64. Write a program to use pointer with function65. Write a program to keep count of created objects

using static members

3

Page 4: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Practical No. 1INTRODUCTION TO COMPUTER HARDWARE

CPU:

It is the central electronic chip that determines the processing power of the computer, machine that executes computer programs.

Motherboard:

In personal computers, a motherboard is the central printed circuit board (PCB) in many modern computers and holds many of the crucial components of the system, providing connectors for other peripherals. The motherboard is sometimes alternatively known as the main board, system board, or, on Apple computers, the logic board.From the CPU to storage devices, from RAM to printer ports, the motherboard provides the connections that help them work together.The motherboard is the main circuit board inside your PC. Every component at some point communicates through the motherboard, either by directly plugging into it or by communicating through one of the motherboards ports. The motherboard is one big communication highway. Its purpose inside your PC is to provide a platform for all the other components and peripherals to talk to each other.

4

Page 5: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

The Power   Supply :

The internal power supply is responsible for converting your standard household power into a form that your computer can use. The power supply is responsible for powering every device in your computer; if it has a problem or is of low quality you may experience many difficulties that you may not realize are actually the fault of the electrical system. This section discusses what makes up the power supply and how it works in detail.

The Processor Socket:

Sockets are the home for your Central Processor Unit (CPU). Several types of socket exist, but only 2 of them are really used, and both of them are used by Intel and AMD. The Pin Grid Array (PGA) and the Land Grid Array (LGA).

5

Page 6: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

With the type PGA, the CPU will have pins to fit in the socket holes, but with the type LGA, the CPU will not have such pins and will just sit on the socket. To know the form of CPU your motherboard can use and the range of powers and FSBs, look in your motherboard's book. The book that comes with your motherboard has a chart about it in the socket or CPU chapter. That information will give you an idea to how far you can upgrade your CPU.

System Bus:

It is the bus that connects the CPU to main memory on the motherboard. I/O buses, which connect the CPU with the systems other components, branch off of the system bus.The system bus is also called the frontside bus, memory bus, local bus, orhost bus.

Random-access Memory (RAM):

Random-access memory (RAM) is a form of computer data storage. Today, it takes the form of integrated circuits that allow stored data to be accessed in any order (that is, at random). "Random" refers to the idea that any piece of data can be returned in a constant time, regardless of its physical location and whether it is related to the previous piece of data.

Memory slots:

Memory slots also call memory banks are for Random Access Memory modules (RAM). Each memory bank can receives a RAM module designed for a specific pc mother board. Ranging from 2 to 4 banks, you will encounter single and dual-channel technologies.

6

Page 7: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

With single-channel, you can use 1, 2 or 3 Ram modules, and it should work perfectly. On the other hand, with dual-channel technology, if you fill only 1 bank, you will lose some strength from your module. To get the most of it, you need to fill 2 banks with the same module types, from the same manufacturer with exactly the same memory amounts.

32 bit PCI Slots:

32 bit slots Peripheral Component Interconnect (PCI) are used to install sound cards, graphic cards, Ethernet cards and modems.

The motherboard parts Accelerated Graphics Port (AGP) and PCI Express (PCIe) focus on graphic cards only. PCIe standard is even better than AGP standard, and mostly the only one used right now. More motherboard content will be written on it, especially for graphic cards.

Motherboard Battery:

The battery gives the board a small amount of power in order to store some vital data on your machine when the power is off. Data stored is that like the time and date so you don't have to reset them every time you boot the machine up. Motherboard batteries are usually long lasting Lithium batteries. Removing this can reset all the data on your machine including the BIOS settings, however not replacing this correctly can lead to irreparable damage to the motherboard. Only remove the battery if it is dead or if you can't have access any other way to resetting the data on your machine by use of the clear CMOS jumper or something similar.

7

Page 8: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Hard Disk Drive:

A hard disk drive (HDD) is a non-volatile, random access device for digital data. It features rotating rigid platters on a motor-driven spindle within a protective enclosure. Data is magnetically read and written on the platter by read/write heads that float on a film of air above the platters.

Introduced by IBM in 1956, hard disk drives have fallen in cost and physical size over the years while dramatically increasing in capacity. Hard disk drives have been the dominant device for secondary of data in general purpose computers since the early 1960s. They have maintained this position because advances in their areal recording density have kept pace with the requirements for secondary storage. Today's HDDs operate on high-speed serial interfaces; i.e., serial ATA (SATA) or serial attached SCSI (SAS).

Disc Drive:

In computing, an optical disc drive (ODD) is a disk drive that uses laser light or electromagnetic waves near the light spectrum as part of the process of reading or writing data to or from optical discs. Some drives can only read from discs, but recent drives are commonly both readers and recorders. Recorders are sometimes called burners or writers. Compact discs, DVDs, and Blue-ray discs are common types of optical media which can be read and recorded by such drives.

8

Page 9: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Optical disc drives are an integral part of stand-alone consumer appliances such as CD players, DVD players and DVD recorders. They are also very commonly used in computers to read software and consumer media distributed in disc form, and to record discs for archival and data exchange. Optical drives—along with flash memory—have mostly displaced floppy disk drives and magnetic tape drives for this purpose because of the low cost of optical media and the near-ubiquity of optical drives in computers and consumer entertainment hardware.

Back Panel Connectors:

When the computer is mounted, those motherboard parts show up at the computer case back panel. They are used to plug the mouse, keyboard, monitor, printer, sound system and any other peripherals you may have.

9

Page 10: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

INPUT DEVICES

Keyboard:

In computing, a keyboard is a typewriter keyboard, which uses an arrangement of buttons or keys, to act as mechanical levers or electronic switches. After punch cards and paper tape, interaction via teletype-style keyboards became the main input device for computers. A keyboard typically has characters engraved or printed on the keys and each press of a key typically corresponds to a single written symbol. However, to produce some symbols requires pressing and holding several keys simultaneously or in sequence. While most keyboard keys produce letters, numbers or signs (characters), other keys or simultaneous key presses can produce actions or computer commands.

10

Page 11: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Mouse:

In computing, a mouse is a pointing device that functions by detecting two-dimensional motion relative to its supporting surface. Physically, a mouse consists of an object held under one of the user's hands, with one or more buttons. It sometimes features other elements, such as "wheels", which allow the user to perform various system-dependent operations, or extra buttons or features that can add more control or dimensional input. The mouse's motion typically translates into the motion of a cursor on a display, which allows for fine control of a graphical user interface.

OUTPUT DEVICES

Monitor: A monitor or display (sometimes called a visual display unit) is an electronic visual display for computers. The monitor comprises the display device, circuitry, and an enclosure. The display device in modern monitors is typically a thin film transistor liquid crystal display (TFT-LCD) thin panel, while older monitors use a cathode ray tube about as deep as the screen size. Originally computer monitors were used for data processing and television receivers for entertainment; increasingly computers are being used both for data

11

Page 12: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

processing and entertainment. Displays exclusively for data use tend to have an aspect ratio of 4:3; those used also (or solely) for entertainment are usually 16:9 widescreen, Sometimes a compromise is used.

Printer: In computing, a printer is a peripheral which produces a text or graphics of documents stored in electronic form, usually on physical print media such as paper or transparencies. Many printers are primarily used as local peripherals, and are attached by a printer cable or, in most new printers, a USB cable to a computer which serves as a document source.

Practical No. 2STEPS FOR INSTALLING WINDOWS XP

Installing Windows XP can take up to two hours. To make the process more manageable,

it has been broken up into several sections. When you are ready, install Windows XP:

• Part 1: Begin the installation

12

Page 13: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

• Part 2: Continue the installation

• Part 3: Complete the installation

Part 1: Begin the installation

1. Insert the Windows XP CD into your computer and restart your computer.

2. If prompted to start from the CD, press SPACEBAR. If you miss the prompt (it only appears

for a few seconds), restart your computer to try again.

3. Windows XP Setup begins. During this portion of setup, your mouse will not work, so you

must use the keyboard. On the Welcome to Setup page, press ENTER.

13

Page 14: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

4. On the Windows XP Licensing Agreement page, read the licensing agreement. Press the

PAGE DOWN key to scroll to the bottom of the agreement. Then press F8.

5. This page enables you to select the hard disk drive on which Windows XP will be installed.

Once you complete this step, all data on your hard disk drive will be removed and cannot be

recovered. It is extremely important that you have a recent backup copy of your files before

continuing. When you have a backup copy, press D, and then press L when prompted. This

deletes your existing data.

6. Press ENTER to select Unpartitioned space, which appears by default.

7. Press ENTER again to select Format the partition using the NTFS file system, which

14

Page 15: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

appears by default.

8. Windows XP erases your hard disk drive using a process called formatting and then copies

the setup files. You can leave your computer and return in 20 to 30 minutes.

Part 2: Continue the installation

9. Windows XP restarts and then continues with the installation process. From this point

forward, you can use your mouse. Eventually, the Regional and Language Options page

appears. Click Next to accept the default settings. If you are multilingual or prefer a

language other than English, you can change language settings after setup is complete.

15

Page 16: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

10

.

On the Personalize Your Software page, type your name and your organization name. Some

programs use this information to automatically fill in your name when required. Then, click

Next.

11

.

On the Your Product Key page, type your product key as it appears on your Windows XP

CD case. The product key is unique for every Windows XP installation. Then, click Next.

16

Page 17: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

12

.

On the Computer Name and Administrator Password page, in the Computer name box, type

a name that uniquely identifies your computer in your house, such as FAMILYROOM or

TOMS. You cannot use spaces or punctuation. If you connect your computer to a network,

you will use this computer name to find shared files and printers. Type a strong password

that you can remember in the Administrator password box, and then retype it in the Confirm

password box. Write the password down and store it in a secure place. Click Next.

13

.

On the Date and Time Settings page, set your computer’s clock. Then, click the Time Zone

down arrow, and select your time zone. Click Next.

17

Page 18: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

14

.

Windows XP will spend about a minute configuring your computer. On the Networking

Settings page, click Next.

15

.

On the Workgroup or Computer Domain page, click Next.

18

Page 19: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Part 3: Complete the installation

16

.

Windows XP will spend 20 or 30 minutes configuring your computer and will automatically

restart when finished. When the Display Settings dialog appears, click OK.

17

.

When the Monitor Settings dialog box appears, click OK.

18 The final stage of setup begins. On the Welcome to Microsoft Windows page, click Next.

19

Page 20: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

.

19

.

On the Help protect your PC page, click Help protect my PC by turning on Automatic

Updates now. Then, click Next.

20

.

Windows XP will then check if you are connected to the Internet:

• If you are connected to the Internet, select the choice that describes your network

connection on the Will this computer connect to the Internet directly, or through a network?

page. If you’re not sure, accept the default selection, and click Next.

20

Page 21: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

• If Windows XP cannot connect to the Internet, you can connect to the Internet after setup is

complete and click Skip for now.

21

.

Windows XP Setup displays the Ready to activate Windows? page. If you are connected to

the Internet, click Yes, and then click Next. If you are not yet connected to the Internet, click

No, click Next, and then skip to step 24. After setup is complete, Windows XP will

automatically remind you to activate and register your copy of Windows XP.

21

Page 22: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

22

.

On the Ready to register with Microsoft? page, click Yes, and then click Next.

23

.

On the Collecting Registration Information page, complete the form. Then, click Next.

22

Page 23: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

4. On the Who will use this computer? page, type the name of each person who will use the

computer.. Then click Next. To add users after setup is complete or to specify a password to

keep your account private, read Create and customize user accounts.

25

.

On the Thank you! page, click Finish.

23

Page 24: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Congratulations! Windows XP setup is complete. You can log on by clicking your name

on the logon screen.

Practical No. 3

CONTROL PANEL

24

Page 25: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Accessibility Options - Here you can change settings for your keyboard, mouse, display

and sound.

Add Hardware - This will open the Add Hardware Wizard which will search your

computer for new hardware that you have installed when Windows does not recognize it

on its own.

Add or Remove Programs - If you need to install or uninstall any software on your

computer, this is where you will do it. You should always uninstall software rather than

delete it from your hard drive.

25

Page 26: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Administrative Tools - This section of your Control Panel is used for administrative

functions such as managing your computer, monitoring performance, editing your

security policy and administering your computer's services..

Automatic Updates - Here is where you tell Windows how and when to update itself.

You can control whether or not it downloads updates automatically or at all and when

you want them installed or to ask you before installing them.

Bluetooth Devices - If you are using any Bluetooth devices on your computer here is

where you can add, remove and manage them.

Date and Time - This one explains itself. You can set your computer's date, time and

regional settings here.

Display - The display settings allow you to change the way things appear on the screen.

You can adjust items like the screen resolution and color depth. Here is where you can

select your background wallpaper and setup your screensaver.

Folder Options - This is where you can adjust the way you view your files and folders

from within My Computer or Windows Explorer.

Fonts - The Fonts applet allows you to add, remove and manage fonts on your computer.

It will show you what fonts are installed in your system.

Game Controllers - If you use a joystick, steering wheel or any other type of game

controller you can use this section to add, remove and troubleshoot the devices.

Internet Options - If you use Internet Explorer for your web browser you will go here to

change settings such for history, connections and security among other things.

Keyboard - Here you can adjust settings such as how fast the keyboard will repeat a

character when a key is held down and the cursor blink rate.

26

Page 27: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Mail - The Mail applet lets you adjust your properties for your Outlook or Exchange

email settings.

Mouse - Here you can adjust your mouse setting for features such as double click speed,

button assignment and scrolling. You can also change your mouse pointers and effects as

well as view details about your mouse.

Network Connections - This item is where you can check and adjust your network

connection settings. It will take you to the same place as if you were to right click My

Network Places and choose properties. It will show all of your active network, dialup and

wireless connections. There is also a New Connection Wizard to help you setup a new

connection.

Phone and Modem Options - If you have a modem installed on your system and uses it

for dialup connections or faxing you can change the settings here. The Dialling Rules tab

allows you to change settings for things such as dialling a number to get an outside line

and setting up carrier codes for long distance and using calling cards. The Modems tab

allows you to add, remove and changed the properties for installed modems. The

Advanced tab is for setting up telephony providers.

Power Options - Here is where you adjust the power settings of your computer.

Windows has built in power schemes for different settings such as when to turn off the

monitor or hard drives and when to go into standby mode. You can even create your own

schemes and save them. The advanced tab allows you to assign a password to bring the

computer out of standby and tell the computer what to do when the power or sleep

buttons are pressed. If you want to enable hibernation or configure an attached UPS then

you can do it here as well. This area can also be accessed from the display properties

settings under the Screensaver tab.

Printers and Faxes - This area is where your printers are installed and where you would

go to manage their settings. It's the same area that is off of the Start menu. There is an

add printer wizard which makes it easy to install new printers. To manage a printer you

would simply right click it and select properties.

27

Page 28: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Regional and Language Options - If you need to have multiple languages or formats for

currency, date and time you can manage them here.

Scanners and Cameras - Windows provides a central place to manage your attached

scanners and camera and adjust their settings. There is even a wizard to add new devices

to make the process of installing a scanner or camera easier.

Scheduled Tasks - This item provides the ability for you to schedule certain programs to

run at certain times of the day. For example if you have a batch file you want to run every

night you can set it up here. You can also have it run a program at any scheduled interval

you choose. There is a handy wizard to help you through the process.

Security Center - The Windows Security Center checks the status of your computer for

the stats of your firewall, virus protection and automatic updates. A firewall helps protect

your computer by preventing unauthorized users from gaining access to it through a

network or the Internet. Antivirus software can help protect your computer against

viruses and other security threats. With Automatic Updates, Windows can routinely

check for the latest important updates for your computer and install them automatically.

Sounds and Devices - Here is where you can adjust your sound and speaker settings. The

Volume tab has settings to mute your system, have a volume icon placed in the taskbar

and tell your computer what type of speakers you are using such as a 5.1 system.

The sounds tab lets you adjust what sounds occur for what windows events. If you need

to change what device is used for playback and recording you can do it under the Audio

tab. Voice playback and recording settings are under the Voice tab. To troubleshoot your

sound device you can use the Hardware tab. This is where you can get information about

your particular sound device.

Speech Properties - Windows has a feature for text to speech translation where the

computer will read text from documents using a computer voice that you can hear

through your speakers. The type of voice and speed of the speech can be adjusted here.

28

Page 29: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

System - If you have ever right clicked My Computer and selected Properties then you

have used the System feature of Control Panel. This area gives you information about

your computer's configuration, name and network status. You can click on the Hardware

tab to view details about hardware profiles and driver signing as well as get to Device

Manager. The Advanced tab lets you change settings for virtual memory (page files) and

other performance settings. There is also an area to change startup and recovery settings

if needed. If you want to enable remote access to your computer for Remote Desktop or

Remote Assistance you can enable it here.

Taskbar and Start Menu - This is where you change the setting for your taskbar and

Start menu.

User Accounts - If you need to manage your local computer users then here is where you

need to go. You can add remove users and change the account types for users who log

into your system

Windows Firewall - This is the same firewall setting described in the Windows Security

Center section.

Wireless Network Setup Wizard - This wizard is used to help you setup a security

enabled wireless network in which all of your computer and devices connect through a

wireless access point.

Practical No. 4

PRACTICE WITH MS-WORD

29

Page 30: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Opening and closing document preparation of document, preparation of

document, setting of document, Familiarization with various tools, mail

merge practice

To begin, open Microsoft Word by choosing ms-word application from all programs

menu pad of start menu, then open new.

Your screen will then look like the one shown here.

30

Page 31: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

The Title Bar

The Title bar is located at the very top of the screen. On the Title bar, Microsoft Word

displays the name of the document on which you are currently working. At the top of

your screen, you should see "Microsoft Word - Document1" or a similar name.

The Menu Bar

The Menu bar is generally found directly below the Title bar. The Menu bar displays the

menu. The Menu bar begins with the word File and continues with Edit, View, Insert,

Format, Tools, Table, Window, and Help. You use the menus to give instructions to the

software. Point with your mouse to a menu option and click the left mouse button to open

a drop-down menu. You can now use the left and right arrow keys on your keyboard to

move left and right across the Menu bar options.

31

Page 32: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

To select an option, click the option or use the arrow keys to move to the option on the

drop-down menu and press Enter. An ellipse or a right arrow after a menu item signifies

additional options; if you select that menu item, a dialog box appears. Items in gray are

not available.

Toolbars

The Standard   Toolbar

The Formatting Toolbar

Toolbars provide shortcuts to menu commands. Toolbars are generally located just below

the Menu bar. Follow these steps:

1. Click View on the Menu bar.

2. Highlight Toolbars.

3. Click Customize.

32

Page 33: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

4. Click the Toolbars tab.

5. Point to the box next to the unchecked option and click the left mouse button to

make a check mark appear..

6. Click Close to close the dialog box.

The Ruler

The ruler is generally found below the main toolbars. The ruler is used to change the

format of your document quickly. To display the ruler:

1. Click View on the Menu bar.

2. Click Ruler. The ruler now appears below the toolbars.

Document View

In Word, you can display your document in one of five views: Normal, Web

Layout, Print Layout, Reading Layout, or Online Layout.

Normal View

Normal view is the most often used and shows formatting such as line spacing,

font, point size, and italics. Word displays multiple-column text in one continuous

column.

Web Layout

Web   layout  view enables you to view your document as it would appear in a

browser such as Internet Explorer.

Print Layout

The Print Layout view shows the document as it will look when it is printed.

Reading Layout

Reading Layout view formats your screen to make reading your document more

comfortable.

Outline view

33

Page 34: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Outline view displays the document in outline form. Headings can be displayed

without the text. If you move a heading, the accompanying text moves with it.

1. Before moving ahead, check to make sure you are in Normal view:

2. Click View on the Menu bar.

3. Click Normal.

Text Area

1. Just below the ruler is a large area called the "text area." You type your document

in the text area. The blinking vertical line in the upper left corner of the text area

is the cursor. It marks the insertion point.

Status Bar

34

Page 35: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

The Status bar appears at the very bottom of the screen and provides such information as

the current page, current section, total number of pages, inches from the top of the page,

current line number, and current column number. The Status bar also provides options

that enable you to track changes or turn on the Record mode, the Extension mode, the

Overtype mode, and the Spelling and Grammar check.

Bold, Italicize and Underline

Type the following exactly as shown.

“Menu: Bold Italicize Underline these words All three Regular

Icon: Bold Italicize Underline these words All three Regular

Keys: Bold Italicize Underline these words All three Regular”

35

Page 36: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

On the line that begins with "Menu," highlight the words "All three."

1. Choose Format > Font from the menu.

2. In the Font Style box, click Bold Italic. 

3. In the Underline box, click to open the pull-down menu. Click the type of

underline you want to use.

4. Click OK to close the dialog box.

5. Click anywhere in the Text area to remove the highlighting.

Cut , copy and Paste

You can cut (delete) text from one area of a document and save that text so it can be

pasted elsewhere in the document. When you cut text, it is stored on the Clipboard. You

can also copy text. When you copy text, it is also stored on the Clipboard. Information

stored on the Clipboard stays there until new information is either cut or copied. Each

36

Page 37: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

time you execute Cut or Copy, you replace the old information on the Clipboard with

whatever you just cut or copied. You can paste Clipboard information as often as you

like.

Cut

1. Type the following: 

“I want to move. I am content where I am.”

2. Highlight "I want to move."

3. Choose Edit > Cut from the menu.

4. Your text should now read: 

"I am content where I am."

Copy

Type the following: 

You will want to copy me. One of me is all you need.

1. Highlight "You will want to copy me."

2. Choose Edit > Copy from the menu.

Paste

1. Place the cursor after the period in the sentence: "One of me is all you need."

2. Press the spacebar to leave a space.

3. Choose Edit > Paste from the menu.

4. Your text should now read: 

"You will want to copy me. One of me is all you need. You will want to copy

me."

Spell Check

Word checks your spelling and grammar as you type. Spelling errors display with a red

wavy line under the word. Grammar errors display with a green wavy line under the

37

Page 38: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

error. If you want to spell check your entire document, press F7 and click the spelling

icon , or choose Tools > Spelling and Grammar from the menu. If you want to spell

check part of your document, highlight the area you want to spell check. Then press F7

and click the spelling icon , or choose Tools > Spelling and Grammar from the menu.

Find and Replace

If you need to find a particular word or piece of text, you can use the Find command. If

you want to search the entire document, simply execute the Find command. If you want

to limit your search to a selected area, highlight that area and then execute the Find

command.

After you have found the word or piece of text you are searching for, you can replace it

with new text by executing the Replace command.

Find

1. Choose Edit > Find from the menu.

2. Type the text you want to find in current document.

3. Click Find Next. 

4. The required text is highlighted.

Replace - Using the Menu

1. Choose Edit > Replace from the menu.

2. Type the text you want to find in current document .

3. The required text is highlighted.

4. Click Replace.

5. The following message will appear: "Word has finished searching the selection.

Do you want to search the remainder of the document?"

6. Click No.

7. Click Close.

38

Page 39: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Font Size

1. Highlight the text you want to modify.

2. Choose Format > Font from the menu.

3. Choose the Font tab.

4. Choose the required font size.

5. Click OK.

Fonts

Change the Font

Highlight the required text

1. Choose Format > Font from the menu.

2. Choose the Font tab.

3. In the box below the Font field, click "Arial."

4. Click OK.

Bulleting, Numbering, Undo, Redo

BULLETS AND NUMBERING

In Microsoft Word, you can easily create bulleted or numbered lists of items. Several

bulleting and numbering styles are available, as shown in the examples. You select the

one you wish to use.

Examples -- Numbering

39

Page 40: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Examples -- Bulleting

Numbering

1. Type the following as shown. 

Apple 

Orange 

Grape 

40

Page 41: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Mango 

Cherry

2. Highlight the words you just typed.

3. Choose Format > Bullets and Numbering from the menu.

4. Choose the Numbered tab.

5. Several styles are available to you. Click the style you want to use.

6. Click OK. Your list is now numbered.

To remove the numbering:

1. Highlight the list again.

2. Choose Format > Bullets and Numbering from the menu.

3. Click None.

4. Click OK. Your list is no longer numbered.

Bulleting

1. Highlight the list you typed.

2. Choose Format > Bullets and Numbering from the menu.

3. Choose the Bulleted tab.

4. Several styles are available to you. Click the style you want to use.

5. Click OK. Your list is now bulleted.

To remove bulleting:

1. Highlight the list again.

2. Choose Format > Bullets and Numbering from the menu.

3. Click None.

4. Click OK. Your list is no longer bulleted.

Undo & Redo

You can quickly reverse most commands you execute by using Undo. If you then change

your mind, you can use Redo.

41

Page 42: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Undo & Redo

1. Type “Undo example”.

2. Choose Edit > Undo Typing from the menu. The typing disappears.

3. Choose Edit > Redo Typing from the menu. The typing reappears.

4. Highlight "Undo example."

Tables

Creating a Table

1. Choose Table > Insert > Table from the menu. The Insert Table dialog box opens.

2. Type 4 in the Number of Columns field.

3. Type 5 in the Number of Rows field.

4. Select Auto in the Column Width field.

5. Click OK. Your table should look like the one shown here, with four columns and

five rows.

Mail merge

1. Click on Tools, Letters and Mailings, and finally Mail Merge Wizard.

2. Select if you want to merge contacts into a letter, envelopes, labels or a

directory.

42

Page 43: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

3. Next, select if you want to use your current letter that you have loaded, use

a template that you may have or start from another letter that you created.

4. Next, you have to choose if you want to select Outlook contacts or

contacts from an Excel or Access list. If you are choosing contacts from

Excel, select the file and the particular sheet that they are on. If it’s an

Access file, select the query or table that your contacts are in. You can

also create a brand new list of contacts if you wish.

5. Click all of the boxes with contacts that you want to include.

6. Click on “More Items” on the right hand side and click the particular

fields that you want to merge on the particular parts of the letter that will

change with each contact.

7. Next, you can preview all of your letters, if you wish, but I usually go to

the next step, since you will be able to see all of your letters one after the

other.

8. Here, click on “Edit individual letters”, then click “All” and a new

window will pop up.

9. You are now ready to review and print all of your mail merged letters.

Save File

Save your file by following these instructions:

1. Choose File > Save As from the menu.

2. Specify the correct folder in the Look In field.

3. Name your file by typing lesson7.doc in the File Name field.

4. Click Save.

5. Choose File > Exit from the menu to close Microsoft Word

Exiting Word

To exit Word:

1. Click File.

43

Page 44: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

2. Click Exit, which can be found at the bottom of the drop-down menu.

3. If you have entered text, you will be prompted: "Do you want to save changes to

Document1?" To save your changes, click Yes. Otherwise, click No.

4. Specify the correct folder in the Save In box.

5. Name your file by typing document1.doc in the File Name field.

6. Click Save.

44

Page 45: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find whether a no. Is palindrome or not#include<iostream.h>

#include<conio.h>

void main()

{

int i,num,d,r=0;

clrscr();

cout<<"Enter the number:";

cin>>num;

for(i=0;i<=num;i++)

{

d=num%10;

r=(r*10)+d;

num=num/10;

}

cout<<"The reverse number is:"<<r<<"\n";

if(i==r)

cout<<"The number is palindrome";

else

cout<<"The number is not palindrome";

getch();

}

45

Page 46: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to print the series- 2,4,6……………..20 terms#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a=1,b=2;

do

{

cout<<b<<"\n";

b=b+2;

a++;

} while(a<=20);

getch();

}

46

Page 47: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write aprogram to check whether a no. is greater then 200 or not#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a;

cout<<"\n enter a number ";

cin>>a;

if(a>200)

cout<<"\n no. is greater than 200";

else

cout<<"\n no. is not greater than 200";

getch();

}

47

Page 48: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to enter a no. and enter no. of spaces and then display

it#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

void main()

{

clrscr();

int x,n;

cout<<"enter the no.";

cin>>x;

cout<<"enter the width of spaces ";

cin>>n;

cout<<setw(n)<<x;

getch();

48

Page 49: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

}

Write a program to enter day no. and display the respective day#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int x;

cout<<"Enter the value of x (1-7):";

cin>>x;

cout<<"\nThe alternative day with respect to entered number is:";

switch(x)

{

case 1:

cout<<"Monday";

break;

49

Page 50: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

case 2:

cout<<"Tuesday";

break;

case 3:

cout<<"Wednesday";

break;

case 4:

cout<<"Thursday";

break;

case 5:

cout<<"Friday";

break;

case 6:

cout<<"Saturday";

break;

case 7:

cout<<"Sunday";

break;

default:

cout<<"Not Valid name";

}

getch();

}

50

Page 51: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a small library program to show the use of function#include<iostream.h>

#include<conio.h>

struct library

{ char aname[20];

float price;

int pagen;

51

Page 52: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

};

void main()

{

struct library l;

cout<<"\nenter author name ";

cin>>l.aname;

cout<<"\nenter price ";

cin>>l.price;

cout<<"\nenter page number ";

cin>>l.pagen;

cout<<l.aname<<"\n";cout<<l.price<<"\n";cout<<l.pagen;

getch();

}

Write a program to enter to enter marks of student and display all

information using structures#include<iostream.h>

#include<conio.h>

struct student

{

int clas;

52

Page 53: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

char stun[20];

int rollno,total;

float m1,m2,m3,avg;

};

void main()

{

struct student s;

cout<<"enter class ";

cin>>s.clas;

cout<<"\nenter students name ";

cin>>s.stun;

cout<<"\nenter roll no ";

cin>>s.rollno;

cout<<"\nenter marks in 3 subjects ";

cin>>s.m1;cin>>s.m2;cin>>s.m3;

s.total=s.m1+s.m2+s.m3;

s.avg=s.total/3;

cout<<s.stun<<" a student of class "<<s.clas<<" roll no. "<<s.rollno<<"\n";

cout<<"obtained an average marks of "<<s.avg;

getch();

}

53

Page 54: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

54

Page 55: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to enter employee’s data and display it in a systematic

manner#include<iostream.h>

#include<conio.h>

struct employee

{

int whour;

char empn[20],id[100];

float salary;

};

void main()

{

struct employee e;

cout<<"enter working hours ";

cin>>e.whour;

cout<<"\nenter employee name ";

cin>>e.empn;

cout<<"\nenter id ";

cin>>e.id;

cout<<"\nenter salary ";

cin>>e.salary;

cout<<e.empn<<" works for "<<e.whour<<" hours \n";

cout<<"and earns Rs. "<<e.salary;

getch();

}

55

Page 56: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

56

Page 57: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to create a structure student to enter students data

and display results#include<iostream.h>

#include<conio.h>

struct student

{

int clas;

char sname[20];

int rollno;

float marks;

};

void main()

{

struct student s;

cout<<"enter class ";

cin>>s.clas;

cout<<"\nenter sname ";

cin>>s.sname;

cout<<"\nenter roll no ";

cin>>s.rollno;

cout<<"\nenter marks ";

cin>>s.marks;

cout<<"\n"<<"\n"<<"\n";

cout<<"class is = "<<s.clas<<"\n";

cout<<"surmane = "<<s.sname<<"\n";

cout<<"roll no. = "<<s.rollno<<"\n";

cout<<"%age of marks = "<<s.marks<<"\n";

getch();

}

57

Page 58: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

58

Page 59: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program using structures to get students marks, calculate %age

and then display their grades#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

char name[20];

float m1,m2,m3,m4,per;

cout<<"Enter name of student ";

cin>>name;

cout<<"Enter marks in 1st subject ";

cin>>m1;

cout<<"Enter marks in 2nd subject ";

cin>>m2;

cout<<"Enter marks in 3rd subject ";

cin>>m3;

per=((m1+m2+m3)/3);

cout<<"\n\nStudent Name "<<name;

cout<<"\nPercentage is "<<per<<"%";

if (per>60)

{

cout<<"\nGrade A";

}

else

{

cout<<"\nGrade B";

}

getch();

}

59

Page 60: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

60

Page 61: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to enter a value and transfer the incremented value to

a new variable and display it #include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,b;

cout<<"enter the value of a=";

cin>>a;

b=a++;

cout<<"value of b="<<b;

cout<<"\nvalue of a="<<a;

getch();

}

61

Page 62: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to show use of array by displaying input and output#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float a[100],n,i;

cout<<"Enter the total numbers";

cin>>n;

cout<<"Enter the numbers";

for(i=1;i<=n;i++)

{ cin>>a[i];

}

cout<<"The numbers are\n";

for(i=1;i<=n;i++)

{ cout<<a[i];

cout<<"\n";

}

getch();

}

62

Page 63: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to input elements and then find the position of a

specific element#include<iostream.h>

#include<conio.h>

void main()

{

int a[100],n,i,item,beg,end,mid;

clrscr();

cout<<"Enter the number of elements:";

cin>>n;

cout<<"\n";

cout<<"Enter the numbers in ascending order:";

for(i=0;i<=n-1;i++)

{

cin>>a[i];

}

cout<<endl;

cout<<"Enter the number to be searched:";

cin>>item;

beg=0;

end=n-1;

mid=(beg=end)/2;

while(beg<=end && item !=a[mid])

{

if (item>a[mid])

beg=mid+1;

else

end=mid-1;

mid=(beg+end)/2;

}

if(a[mid]==item)

63

Page 64: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<item<<" is found in position "<<mid+1;

else

cout<<"Item does not exist";

getch();

}

64

Page 65: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find whether a no. is prime or not#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int num,i;

cout<<"Enter a number \n";

cin>>num;

i=2;

while(i<=num-1)

{ If (num%i==0)

{ cout<<"Not a prime number";

break;

}

i++;

}

if (i==num)

{ cout<<"Prime number";

}

getch();

}

65

Page 66: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find greatest of three nos.#include<iostream.h>

#include<conio.h>

void main ()

{

clrscr();

int a,b,c;

cout<<"enter three no.\n";

cin>>a>>b>>c;

if(a>b&&a>c)

cout<<a<<" is the greast no.";

else if(b>a&&b>c)

cout<<b<<" is the greast no.";

else

cout<<c<<" is the greast no.";

getch();

}

66

Page 67: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to calculate simple interest#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int p,r,t,interest;

cout<<" enter principal =";

cin>>p;

cout<<"\n enter rate =";

cin>>r;

cout<<"\n enter time(in years) =";

cin>>t;

interest=(p*r*t)/100;

cout<<" interest is ="<<interest;

getch();

}

67

Page 68: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to conduct multiple functions of multiplication and

addition#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,r,q,tc,x,y,z;

cout<<"1. Total cost \n";

cout<<"2. Addition \n";

cout<<"Enter your choice \n";

cin>>a;

switch(a)

{

case 1:

cout<<"Enter Rate & Quantity";

cin>>r>>q;

tc=r*q;

cout<<"Total cost is:"<<tc;

getch();

break;

case 2:

cout<<"Enter 2 numbers: ";

cin>>x>>y;

z=x+y;

cout<<"sum= "<<z;

getch();

break;

}

}

68

Page 69: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

69

Page 70: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to calculate area and circumference of a circle#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float a,c,r,pi=3.14;

cout<<"Enter Value of Radius=";

cin>>r;

a=pi*r*r;

cout<<"Area="<<a;

c=2*pi*r;

cout<<"\nCircumference="<<c;

getch();

}

70

Page 71: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find biggest element out of the array#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[10],i,n,big;

cout<<"enter no.elements";

cin>>n;

cout<<"enter elements ";

for(i=0;i<n;i++)

cin>>a[i];

big=a[0];

for(i=1;i<n;i++)

{ if(a[i]>big)

big=a[i];

}

cout<<"biggest no. is ";

cout<<big;

getch();

}

71

Page 72: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to print fibbonicci series#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,b,c=0,n=1;

a=0;

b=1;

cout<<"fibbonicci series is \n";

do

{ cout<<c<<"\n";

a=b;

b=c;

c=a+b;

n=n+1;

}

while(n<=15);

getch();

}

72

Page 73: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to check whether license can be issued to the user or

not#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int age;

cout<<"Enter your age:";

cin>>age;

if(age>18)

goto abc;

else

{

cout<<"No license can be issued to you \n";

}

abc:

cout<<"Issue license :)";

getch();

}

73

Page 74: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to display quotient and remainder#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,b;

char ch;

do

{

cout<<"Enter dividend:";

cin>>a;

cout<<"Enter diviser:";

cin>>b;

if(b==0)

{

cout<<"Illegal divisor";

continue;

}

cout<<"Quotient is:"<<a/b<<"\n";

cout<<"Remainder is:"<<a%b<<"\n";

cout<<"Do you have another one? Y/N";

cin>>ch;

}

while(ch!='n');

getch();

}

74

Page 75: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

75

Page 76: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the day respective to the given day no.#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n;

cout<<"Enter the number of the day you want to know";

cin>>n;

switch (n)

{

case 1:

cout<<"Its MONDAY";

break;

case 2:

cout<<"Its TUESDAY";

break;

case 3:

cout<<"Its WEDNESDAY";

break;

case 4:

cout<<"Its THURSDAY";

break;

case 5:

cout<<"Its FRIDAY";

break;

case 6:

cout<<"Its SATURDAY";

break;

case 7:

cout<<"Its SUNDAY";

76

Page 77: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

break;

default:

cout<<"INVALID NUMBER";

}

getch();

}

77

Page 78: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to display results of students in a systematic form

using setw command#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

Void main() {

clrscr();

int a=80,b=90,c=75,d=95,e=60;

cout<<setw(30)<<"Name"<<setw(22)<<"marks\n";

cout<<setw(30)<<"Divya"<<setw(20)<<a<<"\n";

cout<<setw(30)<<"Gurpreet"<<setw(20)<<b<<"\n";

cout<<setw(30)<<"Navjot"<<setw(20)<<c<<"\n";

cout<<setw(30)<<"Jasmine"<<setw(20)<<d<<"\n";

cout<<setw(30)<<"Gagan"<<setw(20)<<e<<"\n";

getch();

}

78

Page 79: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to add 2 nos. using function#include<iostream.h>

#include<conio.h>

float add(float a,float b)

{

return a+b;

}

void main()

{

clrscr();

float a,b,c;

cout<<"Enter the 2 numbers to be added";

cin>>a>>b;

cout<<"Sum=";

cout<<add(a,b);

getch();

}

79

Page 80: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to enter nos. using array and find the position of a

specific no.#include<iostream.h>

#include<conio.h>

void main()

{

int a[100],n,i,item,LOC=-1;

cout<<endl<<"Enter the number of elements:";

cin>>n;

cout<<endl<<"Enter the elements:";

for(i=0;i<=n-1;i++)

{

cin>>a[i];

}

cout<<"Enter the number to be searched:";

cin>>item;

for(i=0;i<=n-1;i++)

{

if (item==a[i])

{

LOC=i;//Successful source

break;

}

}

if (LOC>=0)

cout<<endl<<item<<" is found in position "<<LOC+1;

else

cout<<endl<<"Item does not exist";

getch();

}

80

Page 81: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

81

Page 82: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program that finds area of rectangle circle and triangle

according to user’s requirement#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

int ch;

cout<<"1: For area of Circle"<<endl;

cout<<"2: For area of Rectangle"<<endl;

cout<<"3: For area of Triangle"<<endl;

cout<<"Enter your choice:";

cin>>ch;

if(ch==1)

{

float radius,area;

cout<<"Enter the radius of the circle:";

cin>>radius;

area=3.14*radius*radius;

cout<<"Area of Circle:"<<area;

}

else if(ch==2)

{

float l,b,c;

cout<<"Enter sides of Rectangle:";

cin>>l>>b;

c=l*b;

cout<<"Area of Rectangle:"<<c;

}

else if(ch==3)

82

Page 83: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

{

float a,b,r,s,area1;

cout<<"Enter three sides of triangle:"<<endl;

cin>>a>>b>>r;

s=(a+b+r)/2;

area1=sqrt(s*(s-a)*(s-b)*(s-r));

cout<<"Area of Trianle is:"<<area1;

}

else

{

cout<<"You have not selected the proper choice";

}

getch();

}

83

Page 84: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program that finds square, cube and fifth power of a no.#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

void main()

{

clrscr();

int a,x,y,z;

cout<<"enter any no "; cin>>a;

x=a*a;

y=a*a*a;

z=a*a*a*a*a;

cout<<"the square of the no.is ";

cout<<x<<endl;

cout<<"the cube of the given no. is ";

cout<<y<<endl;

cout<<"the fifth power of the no is ";

cout<<z<<endl;

getch();

}

84

Page 85: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to check whether a string is palindrome or not#include<iostream.h>

#include<conio.h>

#include<string.h>

void main()

{

clrscr();

int t,i,d,x;

char name[20];

cout<<"Enter name \n";

cin>>name;

d=strlen(name);

x=d/2;

d--;

for(i=0;i<x;i++)

{

if (name[i]==name[d])

{

t=0;

}

else

{

t=1;

break;

}

d--;

}

if(t==1)

{

cout<<"it is not a Palindrome \n";

}

85

Page 86: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

else

{

cout<<"it is a Palindrome \n";

}

getch();

}

86

Page 87: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to input a matrix and display it

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[3][3],x,y;

cout<<"Enter value of 3by3 matrix \n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>a[x][y];

}

}

cout<<"The output of matrix is \n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cout<<"\t"<<a[x][y];

}

cout<<"\n";

}

getch();

}

87

Page 88: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

88

Page 89: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to add two matrices and display the result#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[3][3],b[3][3],c[3][3],x,y;

cout<<"Enter elements of 1st matrix \n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>a[x][y];

}

}

cout<<"Enter value of 2nd matrix \n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>b[x][y];

}

}

cout<<"The sum of matrix is:\n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

c[x][y]=a[x][y]+b[x][y];

cout<<c[x][y]<<" \t";

}

89

Page 90: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<endl;

}

getch();

}

90

Page 91: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find transpose of a matrix#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[3][3],b[3][3],x,y;

cout<<"Enter value of 3x3 matrix \n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>a[x][y];

}

}

for (x=0;x<3;x++)

{

for (y=0;y<3;y++)

{

b[x][y]=a[x][y];

}

}

cout<<"transpose of the matrix is "<<"\n";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cout<<b[y][x]<<"\t";

}

cout<<endl;

}

91

Page 92: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

getch();

}

92

Page 93: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to multiply two matrices#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[3][3],b[3][3],c[3][3],x,y,z;

cout<<"Enter vlue of 1st matrix --";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>a[x][y];

}}

cout<<"Enter value of 2nd matrix --";

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cin>>b[x][y];

}}

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

c[x][y]=0;

for(z=0;z<3;z++)

{

c[x][y]=c[x][y]+(a[x][z]*b[z][y]);

}}}

cout<<"product of 1st and 2nd matrix is \n \n";

93

Page 94: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

for(x=0;x<3;x++)

{

for(y=0;y<3;y++)

{

cout<<c[x][y]<<"\t";

}

cout<<endl;

}

getch();

}

94

Page 95: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to print AMRITSAR.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

char a[50];

int i;

cout<<"enter a";

for(i=1;i<=8;i++)

{

cin>>a[i];

}

for(i=1;i<=8;i++)

{

cout<<a[i];

}

getch();

}

95

Page 96: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find average of n numbers.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[100],n,i;

float av,sum;

cout<<" enter n";

cin>>n;

cout<<"enter element of array";

for(i=1;i<=n;i++)

{

cin>>a[i];

}

sum=0;

for(i=1;i<=n;i++)

{

sum=sum+a[i];

}

av=sum/n;

cout<<"the average of numbers is"<<av; getch();

}

96

Page 97: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the smallest element in array.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n,a[100],i,small;

cout<<"enter n";

cin>>n;

cout<<"enter element of array";

for(i=0;i<=n;i++)

{

cin>>a[i];

}

small=a[0];

for(i=1;i<=n;i++)

{

if(a[i]<small)

small=a[i];

}

cout<<"the smallest element in array is"<<small;

97

Page 98: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

getch();

}

Write a program to subtract two matrices.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[10][10],b[10][10],i,j,r1,r2,c1,c2,c[10][10];

cout<<"\n enter the rows and columns for first matrix";

cin>>r1>>c1;

cout<<"\n enter the rows and columns for second matrix";

cin>>r2>>c2;

if((r1==r2)&&(c1==c2))

cout<<" subtraction is possible";

else

{

cout<<"\n subtraction is not possible";

goto ab;

}

cout<<"\n enter the elements of first matrix";

98

Page 99: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

for(i=0;i<r1;i++)

for(j=0;j<c1;j++)

cin>>a[i][j];

cout<<"\n enter the elements of second matrix";

for(i=0;i<r2;i++)

for(j=0;j<c2;j++)

cin>>b[i][j];

for(i=0;i<r1;i++)

for(j=0;j<c1;j++)

{

c[i][j]=a[i][j]-b[i][j];

}

cout<<"\n subtraction is";

for(i=0;i<r2;i++)

{

cout<<"\n";

for(j=0;j<c2;j++)

cout<<c[i][j];

}

ab:

getch();

}

99

Page 100: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the sum of diagonal elements of a matrix.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[10][10],i,j,m,n,sum=0;

cout<<"\n enter the number of rows and column";

cin>>m>>n;

cout<<"\n enter the elements of matrix";

for(i=1;i<=m;i++)

{

for(j=1;j<=n;j++)

{

cin>>a[i][j];

}

}

for(i=1;i<=m;i++)

{

for(j=1;j<=n;j++)

{

if(i==j)

{

sum=sum+a[i][j];

}

}

}

cout<<"\n sum of the diagonal elements:\n "<<sum;

getch();

}

100

Page 101: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the vowels in a given string.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int c,i,n;

char a[15];

cout<<"\n enter the number of character in a string";

cin>>n;

cout<<"\n enter the string";

for(i=1;i<=n;i++)

{

cin>>a[i];

}

c=0;

for(i=1;i<=n;i++)

{

101

Page 102: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

if(a[i]=='a'||a[i]=='o'||a[i]=='i'||a[i]=='e'||a[i]=='u')

{

c=c+1;

}

}

cout<<"\n number of vowels in a string"<<c;

getch();

}

102

Page 103: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to explain the concept of return statement without condition.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int x,y,z, mul(int,int);

cout<<"\n enter the value of x andy"<<endl;

cin>>x>>y;

z=mul(x,y);

cout<<"\n multiplied result"<<z;

getch();

}

int mul(int p,int q)

{

int s;

s=p*q;

return(s);

}

103

Page 104: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to explain the concept of return statement with condition.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int x,y;

void mul(int,int);

cout<<"\n enter the value of x and y";

cin>>x>>y;

mul(x,y);

getch();

}

void mul(int x,int y)

{

int t;

t=x*y;

cout<<"final result"<<t;

return;

}

104

Page 105: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the factorial of a number by using recursion.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n,factorial(int);

cout<<"\n enter the value of n";

cin>>n;

cout<<"\n factorial of "<<n<<"is:"<<factorial(n);

getch();

}

int factorial(int n)

{

int m;

if(n==1)

{

105

Page 106: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

return(1);

}

else

{

m=n*factorial(n-1);

return(m);

}

}

Output:

Write a program to print the Fibonacci series with recursion.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int fibbo(int);

int i;

for(i=1;i<20;i++)

106

Page 107: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<fibbo(i)<<endl;

getch();

}

int fibbo(int i)

{

if(i==1)

{

return(0);

}

else if(i==2)

{

return(1);

}

else

{

return(fibbo(i-2)+fibbo(i-1));

}

}

107

Page 108: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to convert Celsius temperature to Fahrenheit.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float c,f;

cout<<"enter the temperature in celsius";

cin>>c;

f=1.8*c+32;

cout<<"temperature in farenhiet is"<<f;

getch();

}

108

Page 109: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to read the values of w,x,y,z and display the value of p where

p=w+x/y-z.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int w,x,y,z;

float p;

cout<<"enter the value of w,x,y,z";

cin>>w>>x>>y>>z;

p=(w+x)/(y-z);

cout<<"the result is"<<p;

getch();

}

Output:

109

Page 110: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to calculate area of circle, rectangle, triangle depending upon

user’s choice.

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

float ar,r,le,br,a,b,c,s;

int ch;

cout<<"area menu"<<endl;

cout<<"1.circle"<<endl;

cout<<"2.rectangle"<<endl;

cout<<"3.triangle"<<endl;

cout<<"enter your choice";

cin>>ch;

cout<<endl;

switch(ch)

{

case 1:cout<<"enter radius of the circle";

cin>>r;

ar=3.14*r*r;

cout<<"the area of circle is "<<ar;

break;

case 2:cout<<"enter the length and breadth of rectangle";

cin>>le>>br;

ar=le*br;

cout<<"the area of rectangle is "<<ar;

break;

case 3:cout<<"enter the sides of triangle";

cin>>a>>b>>c;

110

Page 111: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

s=(a+b+c)/2;

ar=sqrt(s*(s-a)*(s-b)*(s-c));

cout<<"the area of triangle is "<<ar;

break;

default: cout<<"wrong choice";

}

getch();

}

Output:

Write a program to compute cosine series i.e cos(x)=1-x2/2!-x4/4!-x6/6!+……xn/n!.

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

float x,t,sum;

int i,n=20;

cout<<"input x"<<endl;

cin>>x;

x=(x*3.1412)/180;

111

Page 112: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

t=t+1;

sum=1;

for(i=1;i<=n;i++)

{

t=t*pow((double)(-1),(double)(2*i-1))*x*x/(2*i*(2*i-1));

sum+=t;

}

cout<<"cos(x)="<<sum;

getch();

}

Write a program to swap two numbers using function.

#include<iostream.h>

#include<conio.h>

int main()

{

clrscr();

void swap(int &,int &);

int a,b;

a=7;b=4;

cout<<"the original values are";

cout<<"a="<<a<<"b="<<b<<endl;

swap(a,b);

cout<<"the values after swap() are";

112

Page 113: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<"a="<<a<<"b="<<b<<endl;

return 0;

}

void swap(int &x,int &y)

{

int temp;

temp=x;

x=y;

y=temp;

cout<<"the swapped values are";

cout<<"a="<<x<<"b="<<y<<endl;

getch();

}

Output:

113

Page 114: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program that uses a function to sum n natural numbers starting from a

given number.

#include<iostream.h>

#include<conio.h>

int summat(int first, int count);

int main()

{

clrscr();

unsigned long a,b,sum;

cout<<"enter the first natural number where from the sum is to be calculated";

cin>>a;

cout<<"how many numbers are to be added?";

cin>>b;

sum=summat(a,b);

cout<<"the sum is"<<sum;

return 0;

}

int summat(int first, int count)

114

Page 115: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

{

unsigned long i,s=0,j=first;

for(i=0;i<count;i++)

s+=j++;

return s;

}

Output:

Write a program to multiply two numbers to explain the concept of prototype.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float a,b,mul(float,float);

cout<<"enter the value of a and b"<<endl;

cin>>a>>b;

cout<<"final result is"<<mul(a,b);

getch();

}

float mul(float x, float y)

{

float z;

115

Page 116: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

z=x*y;

return(z);

}

Output:

Write a program to print multiplication table of a no.

#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

void main()

{

clrscr();

int i=1,n,a;

cout<<"enter a number whose table u want to print";

cin>>n;

while(i<=10)

{

a=n*i;

cout<<n<<"*"<<i<<"="<<a<<endl;

i++;

}

getch();

}

116

Page 117: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Output:

Write a program to print 12 as

1

2

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,b,c;

cout<<"enter any two digit number";

cin>>a;

b=a/10;

c=a%10;

cout<<b<<endl<<c;

getch();

}

Output:

117

Page 118: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to print AMRITSAR.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

char a[50];

int i;

cout<<"enter a";

for(i=1;i<=8;i++)

{

cin>>a[i];

}

for(i=1;i<=8;i++)

{

cout<<a[i];

}

getch();

}

118

Page 119: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find average of n numbers.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[100],n,i;

float av,sum;

cout<<" enter n";

cin>>n;

cout<<"enter element of array";

for(i=1;i<=n;i++)

{

cin>>a[i];

}

sum=0;

for(i=1;i<=n;i++)

{

sum=sum+a[i];

}

119

Page 120: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

av=sum/n;

cout<<"the average of numbers is"<<av; getch();

}

Write a program to find the smallest element in array.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n,a[100],i,small;

cout<<"enter n";

cin>>n;

cout<<"enter element of array";

for(i=0;i<=n;i++)

{

cin>>a[i];

}

small=a[0];

120

Page 121: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

for(i=1;i<=n;i++)

{

if(a[i]<small)

small=a[i];

}

cout<<"the smallest element in array is"<<small;

getch();

}

Write a program to subtract two matrices.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[10][10],b[10][10],i,j,r1,r2,c1,c2,c[10][10];

cout<<"\n enter the rows and columns for first matrix";

cin>>r1>>c1;

cout<<"\n enter the rows and columns for second matrix";

cin>>r2>>c2;

if((r1==r2)&&(c1==c2))

cout<<" subtraction is possible";

121

Page 122: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

else

{

cout<<"\n subtraction is not possible";

goto ab;

}

cout<<"\n enter the elements of first matrix";

for(i=0;i<r1;i++)

for(j=0;j<c1;j++)

cin>>a[i][j];

cout<<"\n enter the elements of second matrix";

for(i=0;i<r2;i++)

for(j=0;j<c2;j++)

cin>>b[i][j];

for(i=0;i<r1;i++)

for(j=0;j<c1;j++)

{

c[i][j]=a[i][j]-b[i][j];

}

cout<<"\n subtraction is";

for(i=0;i<r2;i++)

{

cout<<"\n";

for(j=0;j<c2;j++)

cout<<c[i][j];

}

ab:

getch();

}

122

Page 123: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the sum of diagonal elements of a matrix.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a[10][10],i,j,m,n,sum=0;

cout<<"\n enter the number of rows and column";

cin>>m>>n;

cout<<"\n enter the elements of matrix";

for(i=1;i<=m;i++)

{

for(j=1;j<=n;j++)

{

cin>>a[i][j];

}

}

for(i=1;i<=m;i++)

{

for(j=1;j<=n;j++)

{

if(i==j)

123

Page 124: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

{

sum=sum+a[i][j];

}

}

}

cout<<"\n sum of the diagonal elements:\n "<<sum;

getch();

}

Write a program to find the vowels in a given string.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int c,i,n;

char a[15];

cout<<"\n enter the number of character in a string";

124

Page 125: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cin>>n;

cout<<"\n enter the string";

for(i=1;i<=n;i++)

{

cin>>a[i];

}

c=0;

for(i=1;i<=n;i++)

{

if(a[i]=='a'||a[i]=='o'||a[i]=='i'||a[i]=='e'||a[i]=='u')

{

c=c+1;

}

}

cout<<"\n number of vowels in a string"<<c;

getch();

}

125

Page 126: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to explain the concept of return statement without condition.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int x,y,z, mul(int,int);

cout<<"\n enter the value of x andy"<<endl;

cin>>x>>y;

z=mul(x,y);

cout<<"\n multiplied result"<<z;

getch();

}

int mul(int p,int q)

{

int s;

s=p*q;

return(s);

}

126

Page 127: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to explain the concept of return statement with condition.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int x,y;

void mul(int,int);

cout<<"\n enter the value of x and y";

cin>>x>>y;

mul(x,y);

getch();

}

void mul(int x,int y)

{

int t;

t=x*y;

cout<<"final result"<<t;

return;

}

127

Page 128: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to find the factorial of a number by using recursion.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int n,factorial(int);

cout<<"\n enter the value of n";

cin>>n;

cout<<"\n factorial of "<<n<<"is:"<<factorial(n);

getch();

}

int factorial(int n)

{

int m;

if(n==1)

{

128

Page 129: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

return(1);

}

else

{

m=n*factorial(n-1);

return(m);

}

}

Output:

Write a program to print the Fibonacci series with recursion.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int fibbo(int);

int i;

for(i=1;i<20;i++)

129

Page 130: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<fibbo(i)<<endl;

getch();

}

int fibbo(int i)

{

if(i==1)

{

return(0);

}

else if(i==2)

{

return(1);

}

else

{

return(fibbo(i-2)+fibbo(i-1));

}

}

130

Page 131: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to convert Celsius temperature to Fahrenheit.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float c,f;

cout<<"enter the temperature in celsius";

cin>>c;

f=1.8*c+32;

cout<<"temperature in farenhiet is"<<f;

getch();

}

131

Page 132: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to read the values of w,x,y,z and display the value of p where

p=w+x/y-z.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int w,x,y,z;

float p;

cout<<"enter the value of w,x,y,z";

cin>>w>>x>>y>>z;

p=(w+x)/(y-z);

cout<<"the result is"<<p;

getch();

}

Output:

132

Page 133: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to calculate area of circle, rectangle, triangle depending upon

user’s choice.

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

float ar,r,le,br,a,b,c,s;

int ch;

cout<<"area menu"<<endl;

cout<<"1.circle"<<endl;

cout<<"2.rectangle"<<endl;

cout<<"3.triangle"<<endl;

cout<<"enter your choice";

cin>>ch;

cout<<endl;

switch(ch)

{

case 1:cout<<"enter radius of the circle";

cin>>r;

ar=3.14*r*r;

cout<<"the area of circle is "<<ar;

break;

case 2:cout<<"enter the length and breadth of rectangle";

cin>>le>>br;

ar=le*br;

cout<<"the area of rectangle is "<<ar;

break;

case 3:cout<<"enter the sides of triangle";

cin>>a>>b>>c;

133

Page 134: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

s=(a+b+c)/2;

ar=sqrt(s*(s-a)*(s-b)*(s-c));

cout<<"the area of triangle is "<<ar;

break;

default: cout<<"wrong choice";

}

getch();

}

Output:

Write a program to compute cosine series i.e cos(x)=1-x2/2!-x4/4!-x6/6!+……xn/n!.

#include<iostream.h>

#include<conio.h>

#include<math.h>

void main()

{

clrscr();

float x,t,sum;

int i,n=20;

cout<<"input x"<<endl;

cin>>x;

x=(x*3.1412)/180;

134

Page 135: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

t=t+1;

sum=1;

for(i=1;i<=n;i++)

{

t=t*pow((double)(-1),(double)(2*i-1))*x*x/(2*i*(2*i-1));

sum+=t;

}

cout<<"cos(x)="<<sum;

getch();

}

Write a program to swap two numbers using function.

#include<iostream.h>

#include<conio.h>

int main()

{

clrscr();

void swap(int &,int &);

int a,b;

a=7;b=4;

cout<<"the original values are";

cout<<"a="<<a<<"b="<<b<<endl;

swap(a,b);

cout<<"the values after swap() are";

135

Page 136: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

cout<<"a="<<a<<"b="<<b<<endl;

return 0;

}

void swap(int &x,int &y)

{

int temp;

temp=x;

x=y;

y=temp;

cout<<"the swapped values are";

cout<<"a="<<x<<"b="<<y<<endl;

getch();

}

Output:

136

Page 137: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program that uses a function to sum n natural numbers starting from a

given number.

#include<iostream.h>

#include<conio.h>

int summat(int first, int count);

int main()

{

clrscr();

unsigned long a,b,sum;

cout<<"enter the first natural number where from the sum is to be calculated";

cin>>a;

cout<<"how many numbers are to be added?";

cin>>b;

sum=summat(a,b);

cout<<"the sum is"<<sum;

return 0;

}

int summat(int first, int count)

137

Page 138: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

{

unsigned long i,s=0,j=first;

for(i=0;i<count;i++)

s+=j++;

return s;

}

Output:

Write a program to multiply two numbers to explain the concept of prototype.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

float a,b,mul(float,float);

cout<<"enter the value of a and b"<<endl;

cin>>a>>b;

cout<<"final result is"<<mul(a,b);

getch();

}

float mul(float x, float y)

{

float z;

138

Page 139: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

z=x*y;

return(z);

}

Output:

Write a program to print multiplication table of a no.

#include<iostream.h>

#include<conio.h>

#include<iomanip.h>

void main()

{

clrscr();

int i=1,n,a;

cout<<"enter a number whose table u want to print";

cin>>n;

while(i<=10)

{

a=n*i;

cout<<n<<"*"<<i<<"="<<a<<endl;

i++;

}

getch();

}

139

Page 140: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Output:

Write a program to print 12 as

1

2

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a,b,c;

cout<<"enter any two digit number";

cin>>a;

b=a/10;

c=a%10;

cout<<b<<endl<<c;

getch();

}

Output:

140

Page 141: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to print

*

**

***

****

*****

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int i,j;

for(i=1;i<=5;i++)

{

for(j=1;j<=i;j++)

{

cout<<"*";

}

cout<<endl;

}

getch();

141

Page 142: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

}

Output

142

Page 143: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to print

1

12

123

1234.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int i,j,n;

cout<<"enter the value of n";

cin>>n;

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

{

cout<<j;

}

cout<<endl;

}

getch();

}

Output:

143

Page 144: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

144

Page 145: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to print

1

22

333

4444

55555.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int i,j,n;

cout<<"enter the value of n";

cin>>n;

for(i=1;i<=n;i++)

{

for(j=1;j<=i;j++)

{

cout<<i;

}

cout<<endl;

}

getch();

}

Output:

145

Page 146: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

146

Page 147: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to find average of n numbers using while loop.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int i,n;

float av,sum;

cout<<"enter the value of n";

cin>>n;

sum=0;

i=1;

while(i<=n)

{

sum=sum+i;

i++;

}

av=sum/n;

cout<<"the average of n numbers is"<<av;

getch();

}

Output:

147

Page 148: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

148

Page 149: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to display even numbers between 1 to 15.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int a;

a=2;

while(a<=15)

{

a=a+2;

cout<<a<<endl;

}

getch();

}

Output:

149

Page 150: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

W.A.P to check whether a given number is palindrome or not.

#include<iostream.h>

#include<conio.h>

void main()

{

clrscr();

int num,z,rev=0,rem;

cout<<"enter a number";

cin>>num;

z=num;

while(num>0)

{

rem=num%10;

num=num/10;

rev=(rev*10)+rem;

}

if(rev==z)

cout<<"number is palindrome";

else

cout<<"number is not palindrome";

getch();

}

Output:

150

Page 151: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

Write a program to illustrate the use of pointer

#include<iostream.h>#include<conio.h>void main(){ clrscr(); char ab; int r; float p,q; ab='Z'; r=22; p=3.142; q=5.7; cout<<ab<<" is stored at address "<<&ab<<endl; cout<<r<<" is stored at address "<<&r<<endl; cout<<p<<" is stored at address "<<&p<<endl; cout<<q<<" is stored at address "<<&q; getche(); }

Write a program to use pointer with function

#include<iostream.h>#include<conio.h>void main(){ clrscr(); int arr[]={100,200,300,400,500}; void show(int *num,int n); show(&arr[0],4); getch();} void show(int *num,int n) { int i=0;

151

Page 152: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

while(i<=n) { cout<<*num<<endl; i++; num++;}}

Write a program to keep count of created objects using static members#include<iostream.h>#include<conio.h>class X{int codeno;float price;static int count;public:void getval(int i,float j){codeno=i;price=j;++count;}void display(void){cout<<"Code no : "<<codeno<<" ";cout<<"Price : "<<price<<endl;}static void dispcount(void){cout<<"count = "<<count<<endl;}};int X::count=0;int main(){clrscr();X ob1,ob2;ob1.getval(101,25.12);ob2.getval(102,38.19);X::dispcount();X ob3;ob3.getval(103,49.00);X::dispcount();ob1.display();ob2.display();

152

Page 153: COMPUTER HARDWARE - WordPress.com€¦  · Web viewTo begin, open Microsoft Word by choosing ms-word application from all programs menu pad of start menu, then open new. Your screen

ob3.display();getch();return 0;}

153