Which of the following indicate(s)possible values for the variables when the segment finishes execution?(74).     Ⅰ. x=1,y=2    

admin2009-02-15  20

问题 Which of the following indicate(s)possible values for the variables when the segment finishes execution?(74).    
Ⅰ. x=1,y=2            
Ⅱ. x=1,y=3          
Ⅲ. x=4, y=6

选项 A、Ⅰ
B、Ⅰ,Ⅱ
C、Ⅰ, Ⅲ
D、ⅡandⅢ

答案D

解析 译文:结构   
   Cobegin
   Statement1;
   Statement2;
   Coend
   的含义是语句1和语句2并行执行。结构中的两个原子操作是加载一个变量的值和存储一个变量的值。
  【程序段】
   x=0;y=0;
   cobegin
   {x=1;y+=x;}
   {y=2;x+=3;}
   coend
   执行后,变量的值可能是哪个?
   先执行第二句再执行第一句,结果是Ⅱ,否则结果是Ⅲ。
转载请注明原文地址:https://kaotiyun.com/show/jCjZ777K
0

相关试题推荐
最新回复(0)