1 / 16

1. a=? b=? c=? {int a, b, c; a=(b=2+3)/2 - 4+(c=5%2); printf("%d %d %d \n", a, b, c);

1. a=? b=? c=? {int a, b, c; a=(b=2+3)/2 - 4+(c=5%2); printf(&quot;%d %d %d <br>&quot;, a, b, c); }. 2. Сколько раз будет напечатано слово &quot;Привет&quot; ? #include&lt;stdio.h&gt; # define LIMIT 10 main() { int i=0; while(i &lt;LIMIT) printf(&quot; Привет <br>&quot;); i++; }.

jessie
Télécharger la présentation

1. a=? b=? c=? {int a, b, c; a=(b=2+3)/2 - 4+(c=5%2); printf(&quot;%d %d %d \n&quot;, a, b, c);

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. 1. a=? b=? c=? {int a, b, c; a=(b=2+3)/2 - 4+(c=5%2); printf("%d %d %d \n", a, b, c); }

  2. 2. Сколько раз будет напечатано слово "Привет" ? #include<stdio.h> # define LIMIT 10 main() { int i=0; while(i <LIMIT) printf("Привет\n"); i++; }

  3. 3.Сколько раз будет напечатано слово "Привет" ? #include<stdio.h> # define LIMIT 10 main() { unsigned i; i=0; while(i <LIMIT) { printf("Привет\n"); i=i-1; } }

  4. 4.Чему будет равна переменная i после завершения работы цикла? #include<stdio.h> # define LIMIT 10 main() { unsigned i; for(i=0; i <=LIMIT; i ++) printf("Привет\n"); printf("i = %u", i); }

  5. 5. Чему будет равна переменная i ? {int i=1; if (i<0 && (i=2)) i=3; printf("i = %d\n", i);} {int i=1; if ((i=2)&&(i<0)) i=3; printf("i = %d\n", i);}

  6. 6.Чему будет равна переменная i ? {int i=0; int i=2; if (i) i=1; else if(i) i=2; else if(i) i=3; printf("i = %d\n", i); }

  7. 7. Чему будет равно значение переменной a ? {int a= -10; a=(a+1>0) ? a: -a; printf("a = %d\n", a);} ? a : -a++ ? a : -a++

  8. 8. Чему будет равно значение переменной c ? { int c= -10; c=(c+1>0) ? c: -c; printf("c = %d\n", ++c); } c++

  9. 9. Чему будет равно значение переменной s ? { int i= 5; float s=1; s*=(i+=5)/4; printf("s = %5.2f\n", s); } printf("s = %d \n", s);

  10. 10. Чему будет равно значение переменной s ? { int i= 5; float s=1; s*= (float)(i+=5)/4; printf("s = %5.2f\n", s); }

  11. 11. Чему будет равно значение переменной j ? { int j, s=10; for(j=0; s>0 &&(s%=2); j++) printf("j = %d \n", j); }

  12. 12. Сколько раз будет напечатано “Привет”? #include<stdio.h> void hellow(void); main() { int i; for(i=0; i<3; i++) hellow(); } void hellow() { int i=0; while(i++<2) printf("Привет \n"); }

  13. 13. Сколько раз будет напечатано “Привет”? #include<stdio.h> void hellow(void); main() { int i; for(i=0; i<3; i++) hellow(); } void hellow() { static int i=0; while(i++<2) printf("Привет \n"); }

  14. 14. Сколько раз будет напечатано слово Привет? #include<stdio.h> void hellow(void); int count; main() { extern int count; for(count=0; count<3; count++) hellow(); } void hellow() { extern int count; while(count++<2) printf("Привет \n"); }

  15. 15. Сколько раз будет напечатано слово Привет? #include<stdio.h> void hellow(int); main() { int count; for(count=0; count<3; count++) hellow(count); } void hellow(count) { int count; while(count++<2) printf("Привет \n"); }

  16. 16. Какие значения будут выведены в результате работы программы? # define SQR(x) ((x)*(x)) float sqr(float); main() { float x,y; x=y=1; printf("SQR(2)=%4.1f\n", SQR(++x)); printf("sqr(2)=%4.1f\n", sqr(++y)); } float sqr(float x) { return SQR(x); }

More Related