Escolar Documentos
Profissional Documentos
Cultura Documentos
,C' PROGRAMMING
l.
PRACTICE
Write a program to calculate the 4ft power of first 25 odd natural nos.
2. Write a program that will continue to find area of circle for user input radius.
3. Write a program to add first seven terms of the following series
4.
If I
i
i
I
',
i
I
5.
---
Write a program that will continue to find amount accumulated under compound interest
tcheme for user input principal amount, interest rate & number of years till user gives 0
value of principal amount.
6. Write
print one of the following messages depending on the value assigned of flag.
HOT if flag has value I
WARM if flag has value 2
't
I
7. Write switch
statement that will examine the value of char type variable called color and
print one of the foliowing messages
(II) RED if either 'r' or 'R' is assigned to color
(lII) GREEN if either 'g' or 'G' is assigned to color
(IV) BLUE if either 'b' or 'B' is assigned to color
(V) BLACK by default
A. Write a program that will generate every third integer beginning with 2 continuing upto
100. Calculate the sum of these integers which are only divisible by 5.
9. Write a C program to determine user input number is prime or not.
10. Write a program to decide whether the input number is odd or even.
ll. Write a program that user function cirperi ( ) to calculate circumference of a circle. It
should take argument of type float and returns an argument of same type.
12. Write a program which uses a function power ( ) to raise a number to power p.
13. A phone number can be thoq-ght of as having two members std code and phone no. Write
a program uslng strucrure whose members are std code and phone no. Initialize your own
204
Apperdix
205
[rone number' Program shall ask & then accept the other phone no. Finally it
will print
o\Uottr phone nosl
,Ml',ql--rone no. is 712-595431
Your'ghone no.
;;i"bj;;;,:l;
-.";
case' a number read is outside the range I to
5, the ballot should to clnsidered
ballot and the program shourd also count the number
of spoilt bailots.
",
; ;;"i;
l8'
Player name
Team name
Batting average
using cricket, decrare an array player with 5 erements
and write a program to read the
information about all 5 players and print list containing
names of player
and their batting
average.
l9'
type
Month
,"ni.t",
price
of sales
MARUTHI-8OO
0287
MARUTHI-DX
75000
0787
95000
MARUTHI-VAN
Gypsy
write
0488
0888
85OOO
ll,oooo
by the user.
21. Extend the program 20 to read the data
from datafile and print the information on the
user
22. write a program to read. the_1ee of 100 persons
and write the name of persons in the age
group
23.
write
user.
""rar"iirirv.'"it."ourp",
ET&F--
required is
206
24.
size.
time and
(c) Enter
(b) Enter
(c) Enter
Outputs are
will
be
acceptance
and
are
(n)
and machine 2.
are
wOmUet
I
I
I
I
t
I
-:il:
ilr;
:*.
116
sAbject'
APPENDIX C
AUTOCAD PRACTICE
l.
2.
3'
4.
(3, 1)
6. Draw a circle
(7, 1.5)
rectangle.
end points
and t8,2), finally draw rhe circre tangent to both objects having radius 2.
9. Draw the arc having end points (2,2) and (6,2) and rengrh of chord
equars 4.
10. Draw the lollowing figures.
ll.
,r!
,,rfr
208
[i--
(l,l)
(,,,)
12.
209
(iv)
(ii)
(,)
\-,
(iii)
n
1t
A
V
3
(rv)
13. Draw the ellipse having major axis equals to 6 and minor axis equals to 3.
14. Draw the ellipse having center (4,4) and semimajor axis length equals 1.5.
15. Write your name and address using 'text' and 'Dtext' command. Set the height of letter
to 0.5.
16. Write the text in diagonal form as,
IOiIPUTIIHB
17. Draw the ellipse with center (2,3) and semimajor and semiminor axes equals 4 and 2
respectively. Move the ellipse by 4 units in X-directions and 2 units in l/-directions.
18. Draw the hexagon of 2 unit side and make 5 copies of hexagon.
19. Draw rectangle of 3 unit in length and 2 unit in width. Rotate the rectangle about its
center in clockwise direction by angle 45.
20. Draw following triangle and rotate it by 40o about Y-axis.
(3,6)
(2,41
(s,4)
21. Draw circle at any center and of radius 3. Scale the circle about its center by
(ii) 0.2 units
(i) 2 units
22. Using mirror command, draw the following object.
:--!!',*-
21O
24.
.*
*
)K. )K
*)(
)K)(
)(
)(*
*)(
)(
Fie.2aji)
,'
-J
fte 26 (i)
27.
fre. 24
I
1
i
i
I
fie.24 (i)
(ii)
fie.26 (ii)
rte. 27 (i)
rte. 21
(ii)
i
I
i
trE-..
---