0% found this document useful (0 votes)
18 views36 pages

Lesson 12 Programs

Uploaded by

Jane Mandolado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views36 pages

Lesson 12 Programs

Uploaded by

Jane Mandolado
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

Lesson 12: Jump Statements

Program #1 WAP to input the 3 sides of a triangle & print its corresponding type.

Output:

1
Program #2 WAP to input the name of salesman & total sales made by him. Calculate
& print the commission earned.

Output:

2
Program #3 WAP to calculate the wages of a labor.

Output:

3
Program #4 WAP to calculate the area of a triangle, circle, square or rectangle based
on the user’s choice.

4
Output:

5
Program #5 WAP that will print various formulae & do calculations:
Vol of a cube, Vol of a cuboid, Vol of a cyclinder, Vol of sphere.

6
Output:

7
Program #6 WAP that will print various formulae & do calculations:
Vol of a cube, Vol of a cuboid, Vol of a cyclinder, Vol of sphere.

8
9
10
Output:

11
12
13
14
Output:
6a

15
6b

6c

6d

6e

6f

6g

6h

16
6i

6j

6k

6l

6m

6n

6o

17
6p

6q

6r

6s

6t

18
Program #7 WAP to input a no & print its corresponding table.

Output:

19
Program #8 WAP to print the table from 1 to 10 till 10 terms.

Output:

20
21
Program #9 WAP to input a no & print its factorial.

Output:

22
Program #10 WAP to input a no & check whether it is prime or not.

Output:

23
Program #11 WAP to input a no & print all the prime nos upto it.

Output:

24
Program #12 WAP to input a no & print if the no is perfect or not.

Output:

25
Program #13 WAP to find the HCF of 2 nos.

Output:

26
Program #14 WAP to print the Pythagoras triplets within 100. (A Pythagorean triplet
consists of three positive integers a, b, and c, such that a2 + b2 = c2).

Output:

27
28
Program #15 WAP to input a no & check whether its automorphic or not. (An
automorphic number is a number whose square "ends" in the same digits as the
number itself. For example, 52 = 25, 62 = 36, 762 = 5776, and 8906252 =
793212890625, so 5, 6, 76 and 890625 are all automorphic numbers).

Output:

29
Program #16 WAP to convert a given no of days into years, weeks & days.

Output:

30
Program #17 WAP to input a no & check whether it’s an Armstrong no or not. (An
Armstrong no is an integer such that the sum of the cubes of its digits is equal to the
number itself. For example, 371 is an Armstrong number since 33 + 73 + 13 = 371).

Output:

Output:

31
Program #18 A cricket kit supplier in Jalandhar sells bats, wickets & balls. WAP to
generate sales bill. Input form the console the date of purchase, name of the buyer,
price of each item & quantity of each item. Calculate the total sale amount & add 17.5 %
sales tax if the total sales amount >300000 & add 12.5 % if the total sales amount is
>150000 & 7 % otherwise. Display the total sales amount, the sales tax & the grand
total.

32
Output:

33
Program #19 WAP to check whether a given number is magic number or not.

34
Output:

35
Program #20 Write a C program to calculate generic root of the given number. (To find
the generic root of a no we first find the sum of digits of the no until we get a single digit
output. That resultant no is called the generic no. Eg: 456791: 4+5+6+7+9+1=32. 3 +2
=5. So, 5 becomes the generic root of the given no)

Output:

36

You might also like