Page 952 - เตรียมสอบครูผู้ช่วยคอมพิวเตอร์_compressed
P. 952

็
                                             ่
               3. ข้อใดเปนผลรันของโปรแกรมตอไปน    ้ ี
               #include<stdio.h>
               void main(){

                 int age=35;

                 if (age<=60)
                    printf(“You are young\n”);
               }

                       ก. age=35                                  ข. You are young
                       ค. age<=60     ง. ถูกทุกข้อ


                         ็
               4. ข้อใดเปนผลรันของโปรแกรมตอไปน    ี ้
                                             ่
               #include<stdio.h>
               void main(){

                 int age=65;

                 if (age<=60)
                    printf(“You are young\n”);
                 else

                    printf(“You are old\n”);

               }
                       ก. age=65                                  ข. You are old
                       ค. age<=60     ง.                            You are young


                         ็
                                                  ้
                                                                    ็
                                             ่
                                                  ี
               5. ข้อใดเปนผลรันของโปรแกรมตอไปน ถ้าใส่ข้อมูลเข้าไปเปน 1 และ 299
               #include <stdio.h>
               void main( ) {
                       int x, y;
                       printf(“Enter X :” );

                       scanf(“%d”, &x);

                       printf(“Enter Y :” );
                       scanf(“%d”, &y);
                       (x > y) ? printf(“X more than Y”) : printf(“X not more than Y”);

               }

                       ก. X equal Y     ข.                          X more than Y
                       ค. X not more than Y    ง.                   Goodbye





                                                                                                         9
   947   948   949   950   951   952   953   954   955   956   957