1 / 3

97-2 Programming Language

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 個質數。.

millie
Download Presentation

97-2 Programming Language

An Image/Link below is provided (as is) to download presentation 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. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 97-2 Programming Language Exercise #1: function

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

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

More Related