1 / 5

Yes My Master May I help you

#include &lt;stdio.h&gt; int main() { /* 表示をする * / printf(&quot;Yes My Master<br>&quot;); printf(&quot;May I help you<br>&quot;); return(0); }. Yes My Master May I help you.

Download Presentation

Yes My Master May I help you

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. #include <stdio.h>int main(){ /* 表示をする */ printf("Yes My Master\n"); printf("May I help you\n"); return(0);} Yes My Master May I help you

  2. #include <stdio.h>int main(){ /* printfのさまざまな使い方 */ printf("10/3=%d\n",10/3); printf("10/3=%f\n",10.0/3.0); printf("10/3=%lf\n",10.0/3.0); printf("7+1=%3d\n",7+1); printf("7*9=%3d\n",7*9); printf("7+1=%.3f\n",7.0+3.0); return(0);} 10/3=3 10/3=3.33333 10/3=3.33333 7+1= 8 7*9= 63 7/3=2.333

  3. #include <stdio.h>int main(){ /* 10000円での釣銭表示 */ printf("10000: %d\n", 10000-(12*9+15*7)*1.05); /* 5000円での釣銭表示 */ printf("5000 : %d\n", 5000-(12*9+15*7)*1.05); /* 1000円での釣銭表示 */ printf("1000 : %d\n", 1000-(12*9+15*7)*1.05); return(0);} 10000: 1086527532 5000 : 1085450329 1000 : 1082671820

  4. #include <stdio.h>int main(){ /* 変数を用意 */ int total; total = (12*9+15*7)*1.05; /* 10000円での釣銭表示 */ printf("10000: %d\n", 10000-total); /* 5000円での釣銭表示 */ printf("5000 : %d\n", 5000-total); /* 1000円での釣銭表示 */ printf("1000 : %d\n", 1000-total); return(0);} 10000: 9777 5000 : 4777 1000 : 777

  5. #include <stdio.h>int main(){ /* 様々な変数の型 */ int num; long int l_num; float f_num; double d_num; num = -1-2; /* 整数値 */ l_num = 8000000; /* より大きな値の整数値を入れられる */ f_num = 1.234; /* 実数値 */ d_num = 1.23456; /* より精度の高い実数値を入れられる */ printf("%d\n", num); /* int型の表示には%dを指定 */ printf("%ld\n", l_num); /* int型の表示には%dを指定 */ printf("%f\n", f_num); /* int型の表示には%dを指定 */ printf("%lf\n", d_num); /* int型の表示には%dを指定 */ return(0);} -3 8000000 1.234000 1.234560

More Related