Assignment-3

divider
Question-1

Q1. For any character entered through keyboard check whether the entered character is capital letter, small letter, a digit or special symbol.

Question-2

Q2. To find greatest of 3 integers using two methods (a) if-else and (b) ternary operator.

Question-3

Q3. To implement calculator (+,-/,*,% ) using switch statement.

Another Approch

Question-4

Q4. Display month name according to the month number using Switch Statement.

Question-5

Q5. To check whether number is: (a) even or odd (b) negative or positive by using (i) if-else (ii) ternary operator.

Question-6

Q6. To check a no. say ā€˜nā€™ divisible by 5 and/or 8. Print the appropriate message accordingly.

Question-7

Q7. A library charges a fine for every book returned late. For the first 5 days the fine is 50 paisa, for 6-10 days fine is one rupee and above 10 days fine is 5 rupees. If you return the book after 30 days your membership will be canceled. WAP to accept no. of days the member is late to return the book and display the fine or appropriate message.

Question-8

Q8. Write a program to read in 5 numbers and compute the average, max, min, standard deviation.

Question-9

WAP using loop (for, while, do-while):

  • *Factorial of number
  • Whether no. is prime or not
  • X raised to power n
  • Check if the input integer is an Armstrong number or not?
  • Range of set of entered nos. by finding smallest and largest
  • Multiplication table
  • HCF of two numbers
  • GCD of two numbers
  • *Generate Fibonacci series.

Another Approch

Question-10

Q10. Write a program to read in numbers until the number -999 is encountered. The sum of all numbers read until this point should be printed out.

Question-11

Q11. Keep reading in integers until one integer larger than 100 is not input. For example: 4 - 90, 35, 78, 110 QUIT! (since 110 is bigger than 100).

Question-12

Q12. Read in 20 integers and count the even numbers *practice flowchart/algo/pseudocode as well.