Page 945 - เตรียมสอบครูผู้ช่วยคอมพิวเตอร์_compressed
P. 945
int age=35;
if (age<=60)
printf(“You are young\n”);
}
༛ก. age<=60 ข. You are young
ุ
༛ค. age=35༛ง. ถูกทกขຌอ
4. ขຌอ฿ดปຓนผลรันของปรกรมตอเปนีๅ༛
#include<stdio.h>
void main(){
int age=65;
if (age<=60)
printf(“You are young\n”);
else
printf(“You are old\n”);
}
༛ก. age<=60༛ข. You are young
༛ค. age=65 ง. You are old
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 not more than Y༛ข. Goodbye
༛ค. X equal Y ༛ง. X more than Y
6. ขຌอ฿ดปຓนผลรันของปรกรมตอเปนีๅ༛ถຌา฿สขຌอมูลขຌาเปปຓน༛39 ละ༛39
#include <stdio.h>
main(){
int a, b;
printf("Please enter first number : ");
2