FCP PDF
FCP PDF
FCP PDF
file
Subject: FCPIT
Syllabus
1. Familiarization with the Computer System:
To explain the part of the computer system such as system unit, input devices, output
devices connected to the computer.
To explore the outside view of the system unit that includes the panels on front and ports
at the rear
To explore the inside view of the system unit that includes the motherboard, processor,
expansion slots, various add on cards, storage devices, power supply, fans.
To understand the booting process that includes switching on the system, execution of
POST routine, then bootstrap loader, and loading the operating system, and getting it
ready for use.
- to explain the various elements of the desktop such as taskbar, icons (My Computer,
Recycle Bin, etc.), short cuts, notification area.
- to configure the desktop that include selecting the wall paper, selecting the screen
saver with or without password protection, selecting the screen resolution and color
quality.
4. Miscellaneous Features:
- To open an application, folder, document or internet resource from the Run command
- To understand the working of the internet that include the use of protocols, domains,
IP addresses, URLs, web browsers, web servers, mail servers, etc.
- To create email account, sending mails, receiving mails, sending files a attachments,
etc.
6. Microsoft Word:
- To use various formatting features such as bold face, italicize, underline, subscript,
superscript, line spacing, etc.
- To understand the mail merge and to use mail merge feature of MS Word
8. Microsoft Excel:
12. Write a program to find the nature of the roots as well as value of the roots. However, in case
of imaginary roots, find the real part and imaginary part Separately.
13. Write a program, which takes two integer operands and one operator form user, performs the
operation and then prints the result.(Consider the operators +,-,*, /, % and use switch
statement).For e.g, the input should be in the form:5 + 3 the output should comes Result = 8.
14. Fibonacci sequence is defined as follows: the first and second terms in the sequence are 0 and
1. Subsequent terms are found by adding the preceding two terms in the sequence. Write a
program to generate the first n terms of the sequence. For example, for n= 8, the output should be
0 1 1 2 3 5 8 13.
15. Write a program to print all the prime numbers between m and n, where the value of m and n
is supplied by the user.
16. The number such as 1991, is a palindrome because it is same number when read forward or
backward. Write a program to check whether the given number is palindrome or not.
17. A positive integer number IJK is said to be Well ordered if I<J<K. For example, number 138
is called well ordered because the digits in the number (1, 3, 8) increase from left to right, i.e., 1
< 3 < 8. Number 365 is not well ordered because 6 is larger than 5. Write a program that will
find and display all possible three digit well ordered numbers. The program should also display
the total number of three digit well ordered numbers found.
18Write a function to computer the highest common factor of integer numbers m and n. Use this
function to find the highest common factor of integer numbers a and b.
19. Given the marks (out of 100) obtained by each student in a test of a class with n students.
Write a program to obtain the following information:
21. Write a program to sort a list of n integer numbers in descending order using bubble sort
method.
22. Create a class named Student with the appropriate data members and member functions to
generate output comprising student's admission no., name, marks in five subjects and the %age
of marks obtained. Write a program to use the Student class
23. Create a class named Complex Number with the appropriate data members and constructors.
Include member functions (defined inside the class) to perform the following operations:
24. Create a class named Height with feet and inches as its data members. Also include
appropriate constructors (and destructor, if required). Include member functions (defined outside
the class) to perform the following operations:
List of Practical
4 Miscellaneous Features.
Practical 1
AIM: Familiarization with theList of Practical
Computer System.
Objective: Providing basic information so that students become familiar to various peripheral
devices.
H/W Requirement: Keyboard, Mouse, CPU, Motherboard, RAM, Hard disk, printers.
Theory:
RAM: Random Access Memory (RAM): allows data and instructions to be accessed randomly from any
memory location (address). Primary storage.
CPU: Control Unit: works with the operating system to move data between auxiliary storage and main
memory; and between main memory and the ALU
Keyboard: Windows PCs use tow basic types of keyboards that are classified by the number of keys
they have:
101-key Enhanced keyboard
104-key Windows keyboard
The windows keyboard has some extra keys that address windows specific functions such as
opening the start menu or opening the shortcut menu.
Many new style keyboards also include keys or buttons for connecting to the internet, sending
and receiving emails, and adjusting the volume of the sound system separate software needed
to manage them.
Right Button
Left Button
Scroll Wheel
Mouse terms:
Printer:
Dot Matrix
Laser Printer
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 2
List
AIM: Navigating with Window of Practical
Explorer.
Objective: As the windows operating system is an important component of computer without which
processing could not be done. So they are exposed to this environment.
Theory:
Windows
The Desktop
The word desktop has been derived from real life desk top were a manager puts all the things required
by her. For instance, on a desktop, there may be pen stand, notepad, calculator, etc. Lying, which are
required by the manager. The desktop of a Windows also serves the same purpose.
WINDOWS DESKTOP
In Windows Operating System, the screen upon which icons, Windows, etc. are displayed is known as
desktop. The Windows Operating System desktop may contain a background, one or more active or
inactive windows, a taskbar and icons. A background can be any thing from a single- color screen to an
elaborate artistic image. All windows and icons are superimposed on the background, whatever it may
be.
The Icons
Icons are the pretty pictures representing Windows elements like files, folders, shortcuts, etc. Icons play
a very important role in graphical user interface.
1. Application icons: These are the graphic rendering of the software packages logo. If you
double click over this icon, the related application gets invoked.
2. Shortcuts icons: These are little graphics pointing to a particular application, document or
folder, etc. By double clicking over them the concerned application/document/folder etc.
becomes active.
3. Document icons: The active document window, which is a window within an application
window, can be minimized to a document icon. Point and double click on the document icon to
restore the document window.
4. Disk-drive icons: Disk-drive icons graphically represent five disk drive options: floppy disk,
hard-disk, network, Ram, and CD-ROM. The floppy disk,
The Taskbar
This is bar that is usually found at the bottom of your screen. The start button about which we have
discussed just now is located on the task bar only.
Apart from the start button, the taskbar hosts the clock, some toolbar and the buttons
corresponding to all open windows.
Buttons on the taskbar show you which windows are open, even if some windows are
minimized or hidden beneath another window. You can easily switch to a different window by
clicking its taskbar button. That is, if you are currently working in Microsoft Excels window and now
you want to switch to Microsoft PowerPoint, which is also active in another window, then, all you
need to do is: click the button representing Microsoft PowerPoint on the taskbar.
To start a program
( MS Paint located on Accessories Group)
1. Click the start button, and then point to programs. The programs sub-menu appears.
2. Point to the group such as Accessories here that contains the program you want to start and
then click the program name i.e., on MSPaint in our case.
To quit an open program
1. Just click the close button in the upper-right corner of the program window
2. Alternatively, you can also click upon Exit option available on the File menu of the application or
you can also press the shortcut key Alt+F4.
Window control buttons
You can work with open windows in Windows 98 by clicking one of the window control buttons
located on the far right of the title bar.
RESTORE: Return a window to its previous size i.e., the original size in which it was opened.
Control Panel
This is used to change the settings of your computer. When you click on the Control Panel on Task bar
windows showing the contents of it appears.
Conclusion: Students are made familiar with the windows operating system , its icons and menus and
Control Panel through the working.
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 3
AIM: Working with WorkingList of Practical
with Control Panel.
Control Panel provides a set of special-purpose administrative tools that you can use to
configure the Windows, applications, and services environment. Control Panel includes default
items that you can use for common tasks (for example, Display and Add Hardware). User-
installed applications and services can also insert icons into Control Panel.
There are two view options for Control Panel: Category View and Classic View.
Category View displays Control Panel icons according to the type of task that the user
wants to perform.
Classic View displays Control Panel icons in a view that is familiar to users of previous
versions of Windows.
1. Select the Switch to Classic View button in the pane on the left-hand side of the screen.
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 4
List
AIM: Miscellaneous Features. of Practical
Windows XP also adds a little flavor to the Services screen in Computer manager. If you are
coming from a Windows 9x environment, Services are applications that can run on a system
without a user being actively logged on.
As you can see in this screenshot, when you select a service, the left side of the screen gives you
ability to start or restart the service, as well as showing you a description of the service.
New Groups
There are some new groups that can be found in XP as well. The picture below is a little small,
so if you want to see a full screen view of this screenshot, click on the image and a larger one
will emerge.
Three Groups listed here are of interest and they are the Network Configuration Operators,
Remote Desktop Users, and the HelpServicesGroup. Network Configuration Operators are
used to designate who can manage network configuration with administrative-type access.
These users do not have administrative access to your system, but they do have it within the
scope of Network and Dial up Connections. Remote Desktop Users have the ability to log on
remotely. The Help Services Group seems to be a littlestrange. The only member is a user
called Support_##### which has a description of This is a vendor's account for the Help and
Support. This user account has the options of Password Never expires and User cannot
Change Password enabled. Could this be a back door to your system for Microsoft.maybe...?
Speaking of User Accounts:
User Accounts
Just about every review that Ive seen on XP has shown the new opening screen for User
Accounts. They also show you that you can change the picture associated with a user account.
What I hadnt seen poking around on the internet was this option:
Now this is a pretty good idea! I was pretty impressed with this improvement. Of course there
will be persons saying This is a security risk. OK. That may be true, but have you ever dealt
with a user that could not remember his or her password? This option creates a boot floppy that
holds authentication for a particular user account in case they forget what their password was.
When the user attempts to Log on to the system, with an incorrect password this screen appears:
Do you see the last option? Click here to use your password reset disk. If you select this option,
Windows prompts you for the disk and forces you to reset your password. The disk can be used
over and over again, but your password is now different. The password is updated on the floppy
when you change it. If you decide to set a password with a user account, XP gives you to the
option to secure all of your files:
If you tell XP to make your files Private, it will Maybe. I could still log on as Steve and see
all of the songs that belonged to me. Maybe I forgot something, or perhaps this is something that
will be fixed in a later release. What about Network Connectivity?
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 5
AIM: Exploring the Internet.List of Practical
Internet, another choice on the Start menu, opens Internet Explorer;
the web browser that comes bundled with Windows XP.
To launch Internet Explorer from the Start menu:
1. Click Start.
2. Choose Internet.
3. Click to open Internet Explorer.
4. To close a program, click the located at the top-right of the window.
Practical 6
List
AIM: Working with MS Word. of Practical
Objective: To understand the Word in depth like creating, editing, formatting and printing the
documents and to understand its good tools like Mail merge
Two Ways
1. Double click on the Microsoft Word icon on the desktop.
2. Click on Start --> Programs --> Microsoft Word
Special Features of MS word
The Menu bar: This toolbar is constructed of word commands and not icons (pictures). The Menu
bar contains all the options available to you in Microsoft Word. Using this toolbar to format and change
your document will often allow you greater control than using the icons on the other toolbars. However,
the other toolbars may be more convenient.
Menu bar.
The Standard toolbar: This toolbar contains icons from common commands such as Save, Print,
Tables, and Spell Check. These icons are convenient but will not bring up the dialogue boxes that allow
you to change the settings of these actions. You should use whichever method works the best for you.
Standard toolbar.
The Formatting toolbar: This toolbar contains icons for common formatting actions, such as Font
Style, Font Size, Bold, Italic, Underline, Alignment, Numbered List, Bulleted List, Indentation, Spacing,
and Font Color. These icons are convenient but will not bring up dialogue boxes that allow you to
change the settings of these actions. You should use whichever method works the best for you.
Formatting toolbar.
FORMATTING
From the same menu (Figure 1), select Layout to customize the layout of your document. Click on Page
Setup, and then select the orientation of your document. Click Portrait if you want your document to be
8.5 x 11 inches (most common). Click Landscape if you want your document to be 11 x 8.5 inches.
FORMATTING TEXT
Before you type, you should select your font style, size, color and attributes (such as bold, italic and
underline) by using the Formatting toolbar or by going to Format > Font. This will open the Font menu
(Figure 3). However, if you wish to change text that has already been typed, click and drag over the text
to be changed to highlight it (or go to Edit > Select All to select the entire document) and change it as
before.
Changing the font attributes in the Font menu.
EDITING
In Microsoft Word, 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 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.
1. Place the cursor after the period in the sentence "I am content where I am."
2. Press the spacebar to leave a space.
3. Choose Edit > Paste from the menu.
4. Your text should now read
"I am content where I am. I want to move.
In Microsoft Word, you can copy text from one area of the document and place that text
elsewhere in the document. As with cut data, copied data is stored on the Clipboard.
Font Size
In Microsoft Word, you can change the size of your font (text). The following exercise illustrates
changing the font size.
Copy: CTRL + C
Align Left: CTRL + L
Bold: CTRL + B
Spell Check: F7
Select All: CTRL + A
Cut: CTRL + X
Align Right: CTRL + R
Italic: CTRL + I
Thesaurus: SHIFT + F7
Undo: CTRL + Z
Paste: CTRL + V
Align Center: CTRL + E
Underline: CTRL + U
Find: CTRL + F
Save: CTRL + S
Help: SHIFT + F1
Redo: CTRL + Y
Insert option
To insert a table:
Click on the Table button in the toolbar, or click on the Table tab at the top of the screen, then click
Insert, and Table.
You will have to specify the number of columns and rows, and then click OK.
Inserting Symbols:
To insert a symbol that isnt on the keyboard (for example, , , 8, ., , etc.), click on the Insert tab, and
then click on Symbol. You can choose which symbol you would like to use, then click on the Insert
button when that symbol is highlighted. Click on the Close button to return to your document.
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 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.
Headers and Footers
Headers and Footers can be used to give a uniform look to the pages of your document. To create one,
go to View > Header and Footer. Use the Header and Footer toolbar to insert and format words and
objects in the header. To move between the header and footer, use the Switch between Header and
Footer button. Click Close to exit the header or footer.
Using
the Header and Footer toolbar.
Mail Merge
Mail merge enables you to create form letters, mailing labels, envelopes, or catalogs. There are two files
needed for a mail merge. The data source contains the data that varies in the merged documents for
example, the name and address of each recipient of a form letter. The data source can be an existing
spreadsheet, database, or text file, or a Word table that you create. The main document contains the
generic information that you want to repeat in each form letter, mailing label, envelope, or catalog.
In the main document, merge fields (name, address, city, state, zip) are the placeholders
that tell Microsoft Word where to insert data from the data source. Merge fields are identified by the
guillemots ( ) around each field. When you execute the merge command, Word automatically
generates letters by replacing the merge fields in the main document with the appropriate data from
the source document. Each row (or record) in the data source produces an individual form letter,
mailing label, envelope, or catalog item. The idea of a mail merge is to save you time and keystrokes;
therefore, type as much information in the main document as possible. For instance, if one of your
merge fields will be a price (i.e. $14.00), type the dollar sign in the main document so you wont have to
type it for every price in the source document.
4. Word will ask if you wish to use the active window as your document or create a new document. If
you began with a blank or
existing document, choose Active Window. The active document becomes the main document. A new
document is created and the Mail Merge tool bar will appear.
Create Data Source Use this method if you dont already have the data stored in another data
source.
Open Data Source Select a Microsoft Word document, or a worksheet, database, or other list, and
then click Open. Click Edit Main Document.
Use Address Book Uses addresses from an electronic address book. Select an address book, and
then click OK . Click Edit Main Document
Here are the functions of the basic buttons in the most commonly-used toolbars in most Microsoft
programs:
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 7
AIM: Working with MS Excel List of Practical
Microsoft Excel
Microsoft Excel is an electronic spreadsheet program.You might of heard the terms
"spreadsheet" and "worksheet". People generally use them interchangebly. To remain consistent
with Microsoft and other publishers the term worksheet refers to the row-and column matrix
sheet on which you work upon and the term spreadsheet refers to this type of computer
application. In addition, the term workbook will refer to the book of pages that is the standard
Excel document.The workbook can contain worksheets,chart sheets, or macro modules.
Active Cell
The cell with the black outline. Data is always entered into the active cell.
Column Letter
Columns run vertically on a worksheet and each one is identified by a letter in the column
header.
Formula Bar
Located above the worksheet, this area displays the contents of the active cell. It can also be used
for entering or editing data and formulas.
Name Box
Located next to the formula bar, the Name Box displays the cell reference or the name of the
active cell.
Row Numbers
Rows run horizontally in a worksheet and are identified by a number in the row header.
Together a column letter and a row number create a cell reference. Each cell in the worksheet
can be identified by this combination of letters and numbers such as A1, F456, or AA34.
Sheet Tabs
By default there are three worksheets in an Excel file.
The tab at the bottom of a worksheet tells you the name of the worksheet - such as Sheet1,
Sheet2 etc. Switching between worksheets can be done by clicking on the tab of the sheet you
wish to access. Renaming a worksheet or changing the tab color can make it easier to keep track
of data in large spreadsheet files.
Office Button
Clicking on the Office Button displays a drop down menu containing a number of options, such
as open, save, and print. The options in the Office Button menu are very similar to those found
under the File menu in previous versions of Excel.
Ribbon
The Ribbon is the strip of buttons and icons located above the work area in Excel 2007. The
Ribbon replaces the menus and toolbars found in earlier versions of Excel.
After you've pressed the OK button you'll notice that a new workbook is created with the
selected sheets only:
Now you have a new workbook with only the selected sheets which you can save as a new file.
1 Functions A function, such as PI(), starts with an equal sign (=). For many functions,
such as SUM(), you can enter arguments within its parentheses. Each function has a specific
argument syntax. Some arguments require exactly one argument, others require or allow several
arguments (that is, some arguments might be optional), and some other functions allow no
arguments at all such as PI().
2 Cell references You can refer to data in worksheet cells by including cell references in
the formula. For example, the cell reference A2 returns the value of that cell or uses that value in
the calculation.
3 Constants You can also enter constants, such as numbers (such as or text values, directly
into a formula.
4 Operators Operators are the symbols that are used to specify the type of calculation that
you want the formula to perform. For example, the ^ (caret) operator raises a number to a power,
and the * (asterisk) operator multiplies numbers.
Create a Chart
To create the column chart shown above, start by creating the worksheet below exactly as
shown.
After you have created the worksheet, you are ready to create your chart.
Create a Column Chart
.
Select cells A3 to D6. You must select all the cells containing the data you want in your chart.
You should also include the data labels.
Choose the Insert tab.
Click the Column button in the Charts group. A list of column chart sub-types types appears.
Click the Clustered Column chart sub-type. Excel creates a Clustered Column chart and the
Chart Tools context tabs appear.
Apply a Chart Layout
Context tabs are tabs that only appear when you need them. Called Chart Tools, there are three
chart context tabs: Design, Layout, and Format. The tabs become available when you create a
new chart or when you click on a chart. You can use these tabs to customize your chart.
You can determine what your chart displays by choosing a layout. For example, the layout you
choose determines whether your chart displays a title, where the title displays, whether your
chart has a legend, where the legend displays, whether the chart has axis labels and so on. Excel
provides several layouts from which you can choose.
Add labels
Before After
Select Chart Title. Click on Chart Title and then place your cursor before the C in Chart and hold
down the Shift key while you use the right arrow key to highlight the words Chart Title.
Type Toy Sales. Excel adds your title.
Select Axis Title. Click on Axis Title. Place your cursor before the A in Axis. Hold down the
Shift key while you use the right arrow key to highlight the words Axis Title.
Type Sales. Excel labels the axis.
Click anywhere on the chart to end your entry.
Switch Data
If you want to change what displays in your chart, you can switch from row data to column data
and vice versa.
Switch Data
Before After
Click your chart. The Chart Tools become available.
Choose the Design tab.
Click the Switch Row/Column button in the Data group. Excel changes the data in your chart.
Change the Style of a Chart
A style is a set of formatting options. You can use a style to change the color and format of your
chart. Excel 2007 has several predefined styles that you can use. They are numbered from left to
right, starting with 1, which is located in the upper-left corner.
Practical 8
List
AIM: Working With Powerpoint of Practical
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 9
AIM: Write a program to find List
theof Practical
nature of the roots as well as value of the
roots. However, in case of imaginary roots, find the real part and imaginary part
Separately.
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
float a,b,c,d,root1,root2;
cout<<"enter values of a,b,c:";
cin>>a>>b>>c;
d=b*b-4*a*c;
if(d==0)
{
root1=(-b)/(2*a);
root2=root1;
cout<<"roots are real and equal";
else if(d>0)
{
root1=-(b+sqrt(d))/(2*a);
root1=-(b-sqrt(d))/(2*a);
cout<<"roots are real and distinct";
}
else
{
root1=(-b)/(2*a);
root2=sqrt(-d)/(2*a);
cout<<"roots are immginary";
cout<<"\nroot1"<<root1<<"\nroot2"<<root2;
getch();
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 10
AIM: write a program, whichList
takesof
twoPractical
integer operands and one operator
from user, perform the result and prints the result.
#include<iostream.h>
#include<conio.h>
int main()
{
float op1,op2,res;
char ch;
cout<<"enter two numbers";
cin>>op1>>op2;
cout<<"\n enter an operator";
cin>>ch;
cout<<"\n";
switch(ch)
{
case'+': res=op1+op2;
break;
case'-': res=op1-op2;
break;
case'*': res=op1*op2;
break;
case'/':if(op2==0)
cout<<"divide by zero error";
else
res=op1/op2;
break;
case'/':if(op2==0)
else
{
int r,q;
q=op2/op1;
r=op2-(q*op1);
res=r;
}
break;
default: cout<<"\n"<<"wrong operator";
}
cout<<"The result is:"<<res;
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 11
List of
AIM: Fibonacci sequence is defined Practical
as follow the first and second terms in the
sequence are 0 and 1. Subsequent terms are found by adding the preceding two
terms in the sequence.
#include<iostearm.h>
#include<conio.h>
int main()
{
clrscr();
unsigned long first,second,third,n;
first=0;
second=1;
cout<<"how many elements in sequence:";
cin>>n;
cout<<"fibonacci series\n";
cout<<first<<second;
for(int i=0;i<n;++i)
{
third=first+second;
cout<<"third is:"<<third;
first=second;
second=third;
}
return=0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 12
AIM: write a program to printList of Practical
the prime numbers between m and n.
#include<iostream.h>
#include<conio.h>
void main()
{
int m,n,i,j,check=0;
cout<<"enter the values of m and n:";
cin>>m>>n;
for(int i=m;i<=n;i++)
{
num=i;
check=;
for(j=2;j<=num/;i++)
{
if(num%j==)
{
check=1;
}
}
if(check==)
cout<<num<<"not prime\n";
}
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 13
List
AIM: write a program to check of Practical
whether the given number is palindrome or not.
#include<iostream.h>
#include<conio.h>
void main()
{
int n,num,digit,rev=0;
cout<<"\n input the number(max.32767):";
cin>>num;
do
{
digit=num%10;
rev=(rev*10)+digit;
num=num/10;
}
while(num!=0);
cout<<"the reverse of number is:"<<rev<<"\n";
if(n==rev)
cout<<"the no. is palindrome";
else
cout<<"\n the number is not palindrome";
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 14
List
AIM: write a program that will findof
andPractical
display all posibile three digit well-order
numbers.
#include<iostream.h>
#include<conio.h>
int main()
{
int num,d1,d2,d3,temp,count=0;
cout<<"well ordered numbers"<<endl;
for(num=100;num<1000;num++)
{
temp=num;
d3=temp%10;
temp=temp/10;
d2=temp%10;
temp=temp/10;
d1=temp%10;
if(d1<d2&&d2<d3)
{
cout<<num<<"\t";
count++;
}
}
cout<<"\n total number of well-order numbers:"<<count<<endl;
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 15
List the
AIM: write a program to compute of Practical
highest common factor of integer
numbers m and n.
#include<iostream.h>
#include<conio.h>
int calcGCD(int a,int b);
int main()
{
int a,b,gcd;
cout<<"\n GCD or HCF of given numbers"<<a<<","<<b<<"is:"<<gcd<<endl;
getchar();
return 0;
}
int calGCD(int a,int b)
{
int num,den,GCD,r;
if(a>b)
{
num=a; den=b;
}
else
{
num=b;
den=a;
}
while(den>1)
{
r=num%den;
if(r==0)
{
GCD=den;
brek;
}
else
{
num=den;
den=r;
}
}
if(den==1)
GCD=1;
return GCD;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 16
Listthe
AIM: G write a program to obtain offollowing
Practicalinformation:(a)minimum and
maximum marks score (b)average score of the class and, (c)number of students
whose score is greater than class's average score.
#include<iostream.h>
#include<conio.h>
int main()
double marks[size],sum=0,avgMarks=0,max=0,min=o,count=0;
for(int i=0;i<size;i++)
cin>>marks[i];
sum+=marks[i];
if(marks[i]>max)
max=marks[i];
if(i==0) min=marks[0];
else if(marks[i]<min)
min=marks[i];
avgMarks=sum/size;
for(int i=0;i<size;i++)
if(marks[i]>avgMarks)
count++;
cout<<"maximun marks:"<<max<<endl;
cout<<"miniimun marks:"<<min<<endl;
cout<<"Average marks:"<<avgMarks<<endl;
cout<<"Number of student having score more than average score of the class:"<<count<<endl;
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 17
Listmatrix
AIM: Write a program to multiply of Practical
Amn by Bpq, given that n= p.
#include<iostream.h>
#include<conio.h>
int main()
{
clrscr();
int a[10][10], b[10][10],c[10][10];
int x,y,i,j,m,n;
cout<<"\nEnter the number of rows and columns for Matrix A:::\n\n";
cin>>x>>y;
cout<<"\n\nEnter elements for Matrix A :::\n\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
cin>>a[i][j];
}
cout<<"\n";
}
cout<<"\n\nMatrix A :\n\n";
for(i=0;i<x;i++)
{
for(j=0;j<y;j++)
{
cout<<"\t"<<a[i][j];
}
cout<<"\n\n";
}
cout<<"\n-----------------------------------------------------------\n";
cout<<"\nEnter the number of rows and columns for Matrix B:::\n\n";
cin>>m>>n;
cout<<"\n\nEnter elements for Matrix B :::\n\n";
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cin>>b[i][j];
}
cout<<"\n";
}
cout<<"\n\nMatrix B :\n\n";
for(i=0;i<m;i++)
{
for(j=0;j<n;j++)
{
cout<<"\t"<<b[i][j];
}
cout<<"\n\n";
}
if(y==m)
{
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
c[i][j]=0;
for(int k=0;k<m;k++)
{
c[i][j]=c[i][j]+a[i][k]*b[k][j];
}
}
}
cout<<"\n-----------------------------------------------------------\n";
for(i=0;i<x;i++)
{
for(j=0;j<n;j++)
{
cout<<"\t"<<c[i][j];
}
cout<<"\n\n";
}
}
else
{
cout<<"\n\nMultiplication is not possible";
}
getch();
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 18
AIM: Write a program to sortList
a list of
of nPractical
integer numbers in descending order
using bubble sort method.
#include<iostream.h>
#include<conio.h>
Void main()
{
Clrscr();
int a[25],i,j,tmp,size;
cout<<\n enter number of elements in the array:;
cin>>size;
cout<<\n enter the elements of array:;
for (i=0; i< size; i++)
cin>>a[i];
for (i=0; i< size; i++)
{
int last = (size- 1) i ;
for(j=0; j<last; j++)
if (a[j] < a[j+1]
{
tmp = a [j];
a[j] = a[j+1]
a[j+1] = tmp;
}
}
cout<<\n array in descending order is:\n;
for(i=0; i< size; i++)
cout<<a[i] <,\n;
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 19
List of Practical
AIM: Create a class with the appropriate data members and member functions.
#include <iostream.h>
#include<conio.h>
class book
{
Private:
int bookno;
char bname[30];
char auname[30];
float bprice;
public:
void getdata()
{
cout<<enter the details<<endl;
cout<<enter the book no;
cin>>bookno;
cout<<enter the book name;
cin>>bname;
cout<<enter author name;
cin>>auname;
cout<<enter the book price;
cin>>bprice;
}
void display()
{
cout<<enter the record<<endl;
cout<<book no<<book no<<endl;
cout<<book name<<bname<<endl;
cout<<author name<<auname<<endl;
cout<<book price<<bprice<<endl;
}
};
void main()
{
class book obj;
clrscr();
obj.getdata();
obj.display();
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 20
List ofNumber
AIM: Create a class named Complex Practical
with the appropriate data
members and constructors. Include member functions (defined inside the class)
to perform the following operations:
cased : c = a. divide(b);
a.output();
cout<<divided by;
b.output();
cout<<:;
c.output();
temp = getchar();
break;
}
cout<<endl;
}
while (ch != q);
return 0;
}
void main()
{
cout<<complex number: operators\n;
cout<<addition \n:
cout<<subtraction \n:
cout<<multiplication \n:
cout<<division \n:
cout<<quit \n:
cout<<choose desired option;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Practical 21
List
AIM: Create a class named Height withof
feetPractical
and inches as its data members. Also include
appropriate constructors (and destructor, if required). Include member functions (defined
outside the class) to perform the following operations:
#include<iostream.h>
const int INCHES_PRE_FOOT=12;
class height
{
private;
int totaLInches;
int feet;
int inches;
public:
Height(void);
Height(int f,int i);
height(int totaLInches);
~Height(void);
void Height::convertTOFeetInches();
void inputHeight()
{ int f,i;
cout<<"enter height in feet and inches";
cin>>feet>>inches;
totaLInches=feet*12+inches;
}
void display()
{
cout<<feet<<"\'"<<inches<<"("<<totaLInches<<"inches)"<<endL;
}
int compare(Height t)
{
if(totaLInches>t.totaLInches)
return 1;
else if(totaLInches==t.totaLInches)
return 0;
else
return -1;
}
int getTotaLInches(void);
void setTotaLInches(int totaLInches);
};
height::height(void)
{
totaLInches=0;
feet=0;
inches=0;
}
Height::Height(int f,int i)
{
feet=f;inches=i;
totaLInches=f*12+i;
}
Height::Height(int totaLInches)
{
this->totaLInches=totaLInches;
convertTOFeetInches();
}
Height::~height(void)
{
}
void Height::convertTOFeetInches()
{
feet=totaLInches/INCHES_PER_FOOT;
inch=totaLInches % INCHES_PRE_FOOT;
}
int Height::getTotaLInches(void)
{
return totaLInches;
}
void Height::TotalLInches(int totaLInches;
convertTOFeetInches();
}
int main()
{
Height h1,h2;
int totaLInches,ft,inch;
cout<<"enter Height 1\n";
cout<<"please enter the total height in inches:";
cin>>totaLInches;
h1.setTotaLInches(totaLInches);
cout<"\nPlease enter height 2\n";
h2.inputHeight();
h1.display();
h2.display();
int res=h1.compare(h2);
if(res==0)
cout<<"Both heights are equal"<<endL;
else if(res==1)
cout<<"First height is greater"<<endL;
else
cout<<"Second height is greater"<<endL;
system("pause");
return 0;
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Experiment - 22
AIM: Write a program for display a message.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
cout<<hello;
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Experiment - 23
AIM: Write a program for addition, subtraction, multiplication and Division of two integer
numbers.
#include<iostream.h>
#include<conio.h>
void main()
{
clrscr();
int a,b,c,d,e,f;
cout<<enter two numbers;
cin>>a>>b;
c=a+b;
cout<<sum is:<<c;
d=a-b;
cout<<subtraction is:<<d;
e=a*b;
cout<<multiplication is:<<e;
f=a/b;
cout<<division is:<<f;
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Experiment - 24
AIM: Write a program to find greatest of three numbers.
#include<iostream.h>
#include<conio.h>
void main()
{
int num1,num2,num3;
cout<<" Enter value for first number";
cin>>num1;
cout<<" Enter value for second number";
cin>>num2;
cout<<" Enter value for third number";
cin>>num3;
if(num1>num2&&num1>num3)
{
cout<<" First number is greatest:"<<endl<<"whick is= "<<num1;
}
else if(num2>num1&&num2>num3)
{
cout<<" Second number is greatest"<<endl<<"whick is= "<<num2;
}
else
{
cout<<" Third number is greatest"<<endl<<"whick is= "<<num3;
}
getch();
}
SRI SUKHMANI INSTITUTE OF ENGINEERING & TECHNOLOGY
Affiliated to PTU, & Approved by AICTE
Experiment - 25
AIM: Write a program to add two numbers using function.
# include <iostream.h>
# include <conio.h>
void main()
{
clrscr();
int i,j,k;
int add(int ,int);
cout<<"\nENTER THE VALUE FOR THE FIRST VARIABLE:->";
cin>>i;
cout<<"\nENTER THE VALUE FOR THE SECOND VARIABLE:->";
cin>>j;
k=add(i,j);
cout<<"\nTHE SUM IS :->"<<k;
getch();
}
int add(int i,int j)
{
return i+j;
}