TRY IT YOURSELF SESSION 8

-------TRY IT YOURSELF SESSION 8--------
 Bài 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.



Bài 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 and output is given below :
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.



Bài 3:Accept values in three variables and print the highest value.


------TRY IT YOURSELF SESSION 10------
Bài 1: Declare a variable which has the age of the person. Print the user’s name as many times as his age.

  
Bài 2:Write a program to generate the following pattern:
1
1 2
1 2 3
1 2 3 4
1 2 3 4 5
1 2 3 4 5 6
1 2 3 4 5 6 7
1 2 3 4 5 6 7 8
1 2 3 4 5 6 7 8 9




Bài 3:Write a program to print a multiplication table for a given number.





            

Comments

Popular Posts