Computer Science I
Practice Program – C++
1. Write a Program in C++ to read a set number from keyboard sand find out largest number in
the given array using pointers.
2. Write a program in C++ to display a series of first fifteen terms of Fibonacci Series
(0,1,2,3,5,…..)
3. Write a Program in C++ to find Greatest Common Divisor (GCD) of two natural numbers.
4. Write an object oriented program in C++ to read an integer number and find out the sum of
all the digits of a number.
5. Write an Object Oriented Program in C++ to read an Integer number and find out the sum of
all the digits of a number. (For example: n = 1256, SUM = 1+2+5+6 = 14 )
6. Write a Program in C++ to convert the given binary number into decimal equivalent using
method convert.
7. Write an Object Oriented Program and implement a class rectangle. Each object of this class
will represent a rectangle accepting its length and width as float. Include an area function
which will calculate the area of the rectangle.
8. Write a Program in C++ to sort ten integer numbers in ascending order
9. Write a C++ program with a function to find whether the year entered is a Leap year or not.
10. Write a C++ program that will read a line of text and count number of words in a text.
11. Implement a point class for two dimensional points(x,y). Include a function dist() to return
points distance from origin (0,0) and a display () function to print result..
12. Write a Program in C++ to count occurrence of character ‘J’ in a given string
13. Write a C++ Program by using swap function to interchange given two number: void
swap(int & X, int & y);
14. Write an object oriented program in C++ that inputs and stores 10 numbers in an array and
prints numbers in reverse order.
15. Write a C++ Program to find smallest of four given integers using min() function to return
smallest of the four given integers int min(int,int,int,int).
16. Write a C++ program to accept a number and test whether it is prime or not.
17. Write a C++ program with Computecircle() function that returns the area a and
circumference c of a circle with given radius r.
18. Write a C++ program to find the greatest common divisor of two numbers. Define a method
‘Find’ to accept values to calculate the GCD and then print it.
19. Implement a class temperature to convert degree Fahrenheit value to degree Celsius value.
20. [ Hint: C/5 = F-32/9, where C is temperature in degree Celsius and F is temperature in
Fahrenheit degree ]
21. Write a C++ program to accept a set of 10 numbers and prints the numbers using pointers.
22. Write a C++ Program to find factorial of given number.
23. Write a program in C++ to read a set of numbers from the keyboard and to find out the
largest number in the given array.
24. Write an object oriented program to implement a class ‘Convert’ to convert degree
Centigrade values to Fahrenheit degree.
25. (Hint C=5/9 (F-32), where C is temperature in degree Celsius and F is temperature in
Fahrenheit degree )
26. Write a C++ program that inputs 10 numbers. Store it in a one dimensional array and print
the sum and average of all the elements of the array.
27. Write a C++ program to check whether the user entered number is palindrome or not.
HTML Programs
Write the HTML Code for the following:
V.I.P.Sales
ERASER 5
PENCIL 7
STATIONARY PEN 10
BOOK 22
TOTAL 44
a) Write the HTML Code for the following Output:
COMPUTER DEVICES ( Text size h2, align center)
INPUT DEVICES
1) Key Board
2) Mouse
STORAGE DEVICES
1) Floppy Disc
2) Compact Disc
a) Write a HTML Code for the Following
b) Write a HTML Code for the Following
College
Arts
a) History
b) Politics
c) Languages
i. English
ii. Marathi
Science
a) Physics
b) Chemistry
c) Biology
Commerce
a) Accounts
a) Write a HTML Code for the Following
XII RESULT Text size h1
STREAM
SCIENCE COMMERCE
ART
Science is a link available where clicking on SCIENCE a web page file “SCIENCE.html” should
be invoked, on clicking commerce a web page file “COMMERCE.html” should be invoked and
on clinking ART a web page file “ART.html” should be invoked.
b) Draw the exact output of the HTML Code.
<HTML>
<HEAD>
<TITLE> Computer Setup </TITLE>
<HEAD>
<BODY>
<H1> <U> Title : Megastar Company Ltd. </U></H1>
<P> Address : Surya Complex, Delhi <P>
<H2> <B> Deals In : </B></H2>
<UL>
<LI> Software
<LI> Hardware
<LI> Peripherals
</UL>
</BODY>
</HTML>
a) Write a HTML Code for the Following
No. of Books Purchased
F.Y.J.C. S.Y.J.C.
Year 2004 1200 1300
2005 1250 1400
b) Write the exact output of the following HTML Code.
<html>
<body>
<h1 align = “center”> H.S.C Board Exam </h1>
<p align =”center”> <i> Subject : Computer Science </i> </p>
<p align =”center”><b> Theory and practical Exams </b></p>
<p align=”center”><u> Total </u> -------------- 200 marks </p>
</body>
</html>
1. Write an HTML Code for the following.
Computer device--- [text size H2, align center]
Input device (i) key board (ii) mouse
Storage device (i) harddisk (ii) floppy disk (iii) compact disk
Output device (i) screen (ii) printer
2. Write an exact output of the following HTML Code.
<html>
<body>
<dl>
<h2><b> Terms related to computer </b></h2>
<dl>
<dt> Protocols
<dd> <b> Protocols </b> are rules by which communicates
<dt> Byte
<dd> <b> Byte </b> is a group of 8 bit
<dl>
</body>
</html>
(c) Write a HTML code for the following output:
Computer Paper-I Paper-II Total
Science
100 100 200
(c) Write a HTML code for the following output:
COMPUTER DEVICES Text size is h2, align center (5)
INPUT DEVICES
1. Key Board
2. Mouse
STORAGE DEVICES
1. Hard Disk
2. Floppy Disk
3. Compact Disk
OUTPUT DEVICES
1. Screen
2. Printer
3)Write code in HTML to create the following list
Software portion
C
C++
Java
Hardware portion
Networking
Architecture
Write HTML code for the following output :
S.N. Student Name Marks Obtained Total
Test – 1 Test -2 Test -3
1 ABC 150 150 125 425
2 LMN 129 130 131 390
3 XYZ 115 125 120 360
Write HTML code for the following output :
ARTS
° MARATHI
° HINDI
° ENGLISH
COMMERCE
° ACCOUNTS
° COSTING
° AUDITING
SCIENCE
° PHYSICS
° CHEMISTRY
° MATHS
° COMPUTER SCIENCE
Write HTML program for web page having following table structure
149
abhi maurya
3
Productio Sohamm 382
n Buriaya 9
028
nath gohil
3
482
Hiren Vishwa
7
Sales
724
Roma Gupta
6
Write exact output of HTML code with font specifications.
<html>
<body>
<h1> <u> H/W components </u> </h1>
<ul>
<li> modem
<li> hub
<ul>
<li>repeator
<li> router
</ul> </ul>
</body>
</html>