Sunday, September 14, 2014

Day 3 - 5: More conditional

1.  Declare two variables x and y. Assign values to these variables. Number x should be printed only if it is less than 2000 or greater than 3000, and number y should be printed only if it is between 100 and 500.
2.  Write a program to show your computer’s capabilities. The user types in a letter of the alphabet and your program should display the corresponding language or package available. Some sample input ans output is given below :
                           Input                                  Output
                           A or a                                Ada
                           B or b                                 Basic
                           C or c                                 COBOL
                           D or d                                dBASE III
                           f or F                                  Fortran
                           p or P                                 Pascal
                           v or V                                Visual C++
Using the ‘switch’ statement to choose and display the appropriate message. Use the default label to display a message if the input does not match any of the above letters.

3.  Accept values in three variables and print the highest value.


2 comments: