CPRG Unit 2 programe with solution



1.Write a program to accept number of seconds and display its corresponding hours, minutes and seconds .


2. Write a C program to find the maximum from given three numbers (Using Nested IF).


3. Write a C program to find that the accepted no is Negative, Positive or Zero.


4. Write a program to check given year is a Leap year or not.


5. Write a C program to find minimum from given 3 numbers (Using Conditional Operator).


6. Write a C program to find the maximum from given three numbers (Without using Nested if, or Logical

Operator, Or Conditional operators).


7. Take marks from the user and print grade accordingly( >=75 marks – Distinction, <75 and >=60 marks – First, <60 and >=50 – Second, <50 and >=35 – Pass, <35 – Fail) using if … else if….else statement and also by using logical operators).


8. Take 2 numbers from the user and print the greater number (Number can be equal).


9. Write a program to check whether the blood donor is eligible or not for donating blood. The conditions laid down are as under. Use if statement. a) Age should be above 18 yrs but not more than 55 yrs.



10. Write a program to calculate bill of a job work done as follows. Use if else statement. a) Rate of typing 3 Rs/page b) Printing of 1st copy 5Rs/pages & later every copy 3Rs/page. The user should enter the number of pages and print out copies he/she wants.


11. The ABC Insurance Company Ltd. Offers the following three categories of car insurance policy to car owners: • Category A, here the basic premium is calculated as 2% of the car’s value. • Category B, here the basic premium is calculated as 3% of the car’s value. • Category C, here the basic premium is calculated as 5% of the car’s value.


12. Write a program to implement calculator using switch case.

Click Here for sultion

Comments

Popular posts from this blog

C++ Practice Program

Cloud Computing Important Question-Answer for University Exam

Software Testing Gujarat University Important Questions For Exam