Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise.

Similar presentations


Presentation on theme: "1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise."— Presentation transcript:

1

2 1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise

3 2 Division and Precedence Rules How can we obtain only the remainder of a division operation? What type of numbers would result in only the quotient after the division? If two operators are of equal precedence in an expression, which one is applied first? How can we change the default precedence of operators?

4 3 Lab Exercise (Demo due Sep 21) Write a program that asks the user to input a number between 1 and 5,000. The program then displays the thousands digit, hundreds digit, tens digit and ones digit of the number, each on a separate line. Finally, the program displays the original number reversed on one line. See example interactions on next two slides.

5 4 Sample Run-1 of Number Separator Program Please enter a number between 1 and 5000: 3927 Here are the digits one by one 3 9 2 7 Here is the number in reverse 7293 Press any key to continue

6 5 Run-2 Please enter a number between 1 and 5000: 21 Here are the digits one by one 0 0 2 1 Here is the number in reverse 1200 Press any key to continue


Download ppt "1 Lab Session-3 CSIT 121 Fall 2004 Section-3 should finish Lab-1 Exercise first Division rules Operator precedence rules Lab Exercise."

Similar presentations


Ads by Google