# 97-2 Programming Language - PowerPoint PPT Presentation

1 / 3

97-2 Programming Language. Exercise #1: function. Demo 1. 試撰寫 int mod(int x, int y) 函數，計算 x/y 的餘數。並利用此函數來計算 mod(17, 5) ，即計算 的餘數。. Demo 2. 試撰寫一 int prime(int n) ，可用來找出第 n 個質數（第一個質數為 2 ，第二個質數為 3 ，以此類推），並以此函數找出第 100 個質數。.

I am the owner, or an agent authorized to act on behalf of the owner, of the copyrighted work described.

97-2 Programming Language

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.

- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

## 97-2 Programming Language

Exercise #1: function

### Demo 1

• 試撰寫int mod(int x, int y) 函數，計算x/y的餘數。並利用此函數來計算mod(17, 5)，即計算 的餘數。

### Demo 2

• 試撰寫一int prime(int n)，可用來找出第n個質數（第一個質數為2，第二個質數為3，以此類推），並以此函數找出第100個質數。