Docsity

PSUC Lab Assignment: Programming Exercises, Assignments of Performing Arts

Toggle sidebar
bg1
Assignment PSUC Lab
1. Write a program to print the average of ages of 10 number of students in
a class.
2. Calculate an amount of a telephone bill for the following criteria.
(Without Loop)
Calls charge per call (Rs.)
1-150 0
151-250 0.9
251-400 1.2
401 onwards 1.5
3. Write a program to print the even numbers from 1 to 50. Also count the
number of such numbers.
4. Write a program to find a factorial of a number.
5. Write a program to print the Fibonacci numbers from 1 to 100.
Hint: (Fibonacci series is 0, 1, 1, 2, 3, 5, 8,.. )
6. Check whether given number is Armstrong number or not. An Armstrong
number of three digits 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 3^3 + 7^3 + 1^3 = 371.)

Partial preview of the text

Download PSUC Lab Assignment: Programming Exercises and more Assignments Performing Arts in PDF only on Docsity!

Assignment PSUC Lab

  1. Write a program to print the average of ages of 10 number of students in a class.
  2. Calculate an amount of a telephone bill for the following criteria. (Without Loop) Calls charge per call (Rs.) 1-150 0 151-250 0. 251-400 1. 401 onwards 1.
  3. Write a program to print the even numbers from 1 to 50. Also count the number of such numbers.
  4. Write a program to find a factorial of a number.
  5. Write a program to print the Fibonacci numbers from 1 to 100. Hint: (Fibonacci series is 0, 1, 1, 2, 3, 5, 8,.. )
  6. Check whether given number is Armstrong number or not. An Armstrong number of three digits 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 3^3 + 7^3 + 1^3 = 371.)