FYBCS C Exercise_3

Set A: Apply all the three program development steps for the following examples. 

 1. Accept a single digit from the user and display it in words. For example, if digit entered is 9,display Nine. 

 2. Write a program, which accepts two integers and an operator as a character (+ - * /),performs the corresponding operation and displays the result.

 3. Accept two numbers in variables x and y from the user and perform the following operations 

 Set B: Apply all the three program development steps for the following examples. 

 1. Accept radius from the user and write a program having menu with the following options and corresponding actions

2. Write a program having a menu with the following options and corresponding actions


Set C: Write a program to solve the following problems 

1. Accept the three positive integers for date from the user (day, month and year) and checkwhether the date is valid or invalid. Run your program for the following dates and fill the table.(Hint: For valid date 1<=month<=12,1<= day <=no-of-days where no-of-days is 30 in case ofmonths 4, 6,9 and 11. 31 in case of months 1,3,5,7,8,10 and 12. In case of month 2 no-of-days is28 or 29 depending on year is leap or not) 

 2. Write a program having menu that has three options - add, subtract or multiply two fractions.The two fractions and the options are taken as input and the result is displayed as output. Eachfraction is read as two integers, numerator and denominator.  

Post a Comment

0 Comments