Search Header Logo

ComPro: String

Authored by Nanta Janpitak

Computers

University

Used 1+ times

ComPro: String
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

6 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

strcmp("A dog","a DOG");

ได้ผลลัพทธ์เท่าใด

0

1

-1

A dog

a DOG

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

คำสั่งใดผิด

char name[30] = "Kuerkul";

name= "Kuerkul";

strcpy(name,"Kuerkul");

char name[30];

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

ถ้าต้องการเก็บข้อมูลคำว่า "How are you?" ไว้ในตัวแปร s1 ต้องเขียนโปรแกรมอย่างไร

char s1[30];

printf("Enter string : ");

scanf("%s",s1);

char s1[30];

printf("Enter string : ");

gets(s1);

char s1[30];

printf("Enter string : ");

scanf("%c",&s1);

char s1[30];

printf("Enter string : ");

scanf("%c",s1);

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

char name[30];

int id;

scanf("%d",&id);

_____(answer)_______;

gets(name);

เมื่อรันโปรแกรมแล้วกรอก 5 แล้วกด enter หลังจากนั้น กรอก Jane แล้วกด enter
ถ้าต้องการให้ตัวแปร id = 5 และ ตัวแปร name = 'Jane'

ต้องเขียนโปรแกรมตรง (answer) ว่าอย่างไร

getchar();

gets()

input()

ไม่ต้องมีบรรทัดนี้

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

char string1[30];

int i,num;

gets(string1);

num=strlen(string1);

ถ้าป้อนข้อมูล Compro

แล้วสั่งพิมพ์ค่า num จะได้ผลลัพธ์เท่าใด

Compro

6

30

string1

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

char name[30] = "Bill";

char surname[30] = "Gate"

char fullname[60];

ถ้าต้องการให้ fullname คือการเอา surname มาต่อท้าย name ต้องใช้คำสั่งใด

strcpy(name,surname)

strcat(name,surname);

strlen(name,surname)

strcmp(name,surname)

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?