SlideShare ist ein Scribd-Unternehmen logo
1 von 3
BÀI TRẮC NGHIỆM SỐ 4
                                      Ngôn ngữ lập trình C
                                            Thời gian: 15’
Họ tên:………………………………………
Lớp…………………………………………..

Câu 1: Trong C, hàm nào sau đây được dùng để giải phóng bộ nhớ đã được cấp phát?
  a. free
  b. delete
  c. clear
  d. remove

Câu 2: Trong C, khai báo nào dưới đây là khai báo đúng của struct?
  a. struct{int a;}
  b. stuct a_struct{int;}
  c. struct a_struct int a;
  d. struct a_struct{int a;};

Câu 3: Trong C, đối số argc (argument count) lưu trữ giá trị gì?
  a. Số đối số truyền vào trong hàm main
  b. Số lượng đối số truyền vào trong hàm main + 1
  c. Số lượng đối số truyền vào trong hàm main -1
  d. Tổng kích thước tính bằng byte của mảng đối số

Câu 4: Cho đoạn chương trình C sau đây: int a[10], i, *p; a[0] = 1; a[1] = 2; p = a; (*p)++;
a[1]=?
    a. a[1] = 2
    b. a[1] = 3
    c. a[1] = 4
    d. Không đưa ra kết quả.

Câu 5: Thực hiện: Kiểm tra nếu a, b, c đều lớn hơn 1 thì in số 1, chọn câu nào?
  a. if (a>1) or (b>1) or (c>1) then write(1);
  b. if a>1 and b>1 and c>1 then write(1);
  c. if (a>1) and (b>1) and (c>1) then write(1);
  d. if a, b, c > 1 then write(1);

Câu 6: Đáp án nào dưới đây là khai báo hoàn chỉnh của một hàm trong C?
  a. int funct();
  b. int funct(int x) {return x=x+1;}
  c. void funct(int) {printf(quot;Helloquot;)}
  d. void funct(x) { printf(quot;Helloquot;)}

Câu 7:Chỉ thị nào sau đây là đúng khi sử dụng để khai báo một mảng 10 ký tự có tên letters?

   a) letters: char[10];              b) char[10] letters;

   c) char letters[10];               d) char array letters[10];

Câu 8: Câu lệnh nào sau đây là đúng khi gán ký tự ‘Z’ cho phần tử thứ tư của mảng letters?

   a) letters[4]:= “Z”; b) letters[3] = 'Z'; c) letters[4] = quot;Zquot;; d) letters[3] = 'z';
Câu 9: Chỉ thị nào sau đây là đúng khi khai báo mảng hai chiều balances có 3 hàng và 5 cột?

   a) float balances[3][5]; b) balances[3][5] of float; c) float balances[5][3];

   d) array of float balances[0..2][0..5];

Câu 10: Câu lệnh nào sau đây là đúng để gán xâu “Hello” cho mảng ký tự words tại thời
điểm khai báo?

   a) char words[10] = 'Hello'; b) static char words[] = quot;Helloquot;;

   c) static char words[quot;helloquot;]; d) static char words[] = { Hello };

Câu 11: Câu lệnh nào sau đây là đúng để gán xâu “Welcome” cho xâu ký tự stuff?

   a) strcpy( stuff, 'Welcome' ); b) stuff = quot;Welcomequot;; c) stuff[0] = quot;Welcomequot;;

   d) strcpy(stuff, quot;Welcomequot; );

Câu 12 Câu lệnh nào sau đây là đúng để in ra màn hình giá trị của phần tử thứ 3 của mảng
số nguyên có tên totals?

   a) printf(quot;%dnquot;, &totals[3] ); b) printf(quot;%dnquot;, totals[3] );

   c) printf(quot;%cnquot;, totals[2] );   d) printf(quot;%dnquot;, totals[2] );

Câu 13: Câu lệnh nào sau đây là đúng để in ra màn hình xâu ký tự có tên words?

   a) printf(quot;%snquot;, words);         b) printf(quot;%cnquot;, words);

   c) printf(quot;%dnquot;, words);         d) printf(quot;%snquot;, words[2]);

Câu 14: Câu lệnh nào sau đây là đúng để nhập vào giá trị cho xâu ký có tên words từ bàn
phím?

   a) scanf(quot;%snquot;, words);          b) scanf(quot; %cquot;, words);

   c) scanf(quot;%cquot;, words);            d) scanf(quot;%squot;, words);

Câu 15: Chỉ thị nào sao đây là đúng để khai báo một biến con trỏ nguyên có tên address?

   a) int address;            b) address *int;

   c) int *address;           d) *int address;

Câu 16: Câu lệnh nào sau đây là đúng khi gán địa chỉ của biến thực balance cho con trỏ thực
temp?

   a) temp = &balance;               b) balance = float temp;

   c) float temp *balance;           d) &temp = balance;
Câu 17: Câu lệnh nào sau đây là đúng khi sử dụng để gán ký tự ‘W’ cho biến ký tự được trỏ
bởi biến con trỏ ký tự letter?

   a) 'W' = *letter;                b) letter = quot;Wquot;;

   c) letter = *W;                  d) *letter = 'W';

Câu 18: Cho biết kết quả trên màn hình sau khi chạy đoạn chương trình sau?

        int count = 10, *temp; sum = 0;

        temp = &count;

        *temp = 20;

        temp = ∑

        *temp = count;

        printf(quot;count = %d, *temp = %d, sum = %dnquot;, count, *temp, sum );

   a) count = 2, *temp = 10, sum = 10

   b) count = 20, *temp = 20, sum = 20

   c) count = 10, *temp = 2, sum = 10

   d) count = 200, *temp = 0.2, sum = 1

Câu 19: Chỉ thị nào sau đây là đúng khi khai báo một con trỏ trỏ vào xâu “Hello” có tên
message?

   a) char message = quot;Helloquot;;              b) *message = quot;Helloquot;;

   c) char *message = quot;Helloquot;;             d) char message = 'Hello';

Câu 20: Trong ngôn ngữ C, câu lệnh nào sau đây trả về địa chỉ ô nhớ của con trỏ p?

   a.   p;
   b.   *p;
   c.   &p;
   d.   address(p);

Weitere ähnliche Inhalte

Andere mochten auch

Andere mochten auch (10)

Ittlgc2
Ittlgc2Ittlgc2
Ittlgc2
 
Session 7 En
Session 7 EnSession 7 En
Session 7 En
 
Accessibilité commerces
Accessibilité commercesAccessibilité commerces
Accessibilité commerces
 
Ittlgc3
Ittlgc3Ittlgc3
Ittlgc3
 
Charte qualité des terrasses restaurant bar UPCRM Menton
Charte qualité des terrasses restaurant bar UPCRM MentonCharte qualité des terrasses restaurant bar UPCRM Menton
Charte qualité des terrasses restaurant bar UPCRM Menton
 
Test1
Test1Test1
Test1
 
Session 09
Session 09Session 09
Session 09
 
Session 05 Final
Session 05 FinalSession 05 Final
Session 05 Final
 
Session 15
Session 15Session 15
Session 15
 
Internet
InternetInternet
Internet
 

Ähnlich wie Test5

2014 06-23 velocity sc beyond page metrics
2014 06-23 velocity sc beyond page metrics2014 06-23 velocity sc beyond page metrics
2014 06-23 velocity sc beyond page metricsBuddy Brewer
 
Bai Giang 11
Bai Giang 11Bai Giang 11
Bai Giang 11nbb3i
 
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015淳佑 楊
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!Blanca Mancilla
 
Ly Thuyet Va Bai Tap Excel
Ly Thuyet Va Bai Tap ExcelLy Thuyet Va Bai Tap Excel
Ly Thuyet Va Bai Tap Exceltrungtinh
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言Simen Li
 
C++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & RangesC++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & RangesYongwei Wu
 
Vim your Python, Python your Vim
Vim your Python, Python your VimVim your Python, Python your Vim
Vim your Python, Python your VimMiroslav Šedivý
 
Boo Programming Language
Boo Programming LanguageBoo Programming Language
Boo Programming LanguageVitaly Baum
 
090608-TogoWS REST
090608-TogoWS REST090608-TogoWS REST
090608-TogoWS RESTocha_kaneko
 
Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Colin O'Dell
 
Scanned by CamScannero u h a v e a tte m p te d th is .docx
Scanned by CamScannero u  h a v e  a tte m p te d  th is  .docxScanned by CamScannero u  h a v e  a tte m p te d  th is  .docx
Scanned by CamScannero u h a v e a tte m p te d th is .docxkenjordan97598
 
Cbse ugc-net-computer-science-paper-2-december-2014
Cbse ugc-net-computer-science-paper-2-december-2014Cbse ugc-net-computer-science-paper-2-december-2014
Cbse ugc-net-computer-science-paper-2-december-2014Ashish Rai
 
Piotr Szotkowski about "Bits of ruby"
Piotr Szotkowski about "Bits of ruby"Piotr Szotkowski about "Bits of ruby"
Piotr Szotkowski about "Bits of ruby"Pivorak MeetUp
 
Τα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonΤα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonMoses Boudourides
 

Ähnlich wie Test5 (20)

Pre-Cal 40S May 4, 2009
Pre-Cal 40S May 4, 2009Pre-Cal 40S May 4, 2009
Pre-Cal 40S May 4, 2009
 
2014 06-23 velocity sc beyond page metrics
2014 06-23 velocity sc beyond page metrics2014 06-23 velocity sc beyond page metrics
2014 06-23 velocity sc beyond page metrics
 
aaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaa
 
Bai Giang 11
Bai Giang 11Bai Giang 11
Bai Giang 11
 
Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015Introduction to Programming @ NTHUEEECamp 2015
Introduction to Programming @ NTHUEEECamp 2015
 
PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!PyLadies Talk: Learn to love the command line!
PyLadies Talk: Learn to love the command line!
 
Ly Thuyet Va Bai Tap Excel
Ly Thuyet Va Bai Tap ExcelLy Thuyet Va Bai Tap Excel
Ly Thuyet Va Bai Tap Excel
 
Control flow in c
Control flow in cControl flow in c
Control flow in c
 
Bai tap dai_so_tuyen_tinh
Bai tap dai_so_tuyen_tinhBai tap dai_so_tuyen_tinh
Bai tap dai_so_tuyen_tinh
 
Practica 3ro trips
Practica 3ro tripsPractica 3ro trips
Practica 3ro trips
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
 
C++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & RangesC++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & Ranges
 
Vim your Python, Python your Vim
Vim your Python, Python your VimVim your Python, Python your Vim
Vim your Python, Python your Vim
 
Boo Programming Language
Boo Programming LanguageBoo Programming Language
Boo Programming Language
 
090608-TogoWS REST
090608-TogoWS REST090608-TogoWS REST
090608-TogoWS REST
 
Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021
 
Scanned by CamScannero u h a v e a tte m p te d th is .docx
Scanned by CamScannero u  h a v e  a tte m p te d  th is  .docxScanned by CamScannero u  h a v e  a tte m p te d  th is  .docx
Scanned by CamScannero u h a v e a tte m p te d th is .docx
 
Cbse ugc-net-computer-science-paper-2-december-2014
Cbse ugc-net-computer-science-paper-2-december-2014Cbse ugc-net-computer-science-paper-2-december-2014
Cbse ugc-net-computer-science-paper-2-december-2014
 
Piotr Szotkowski about "Bits of ruby"
Piotr Szotkowski about "Bits of ruby"Piotr Szotkowski about "Bits of ruby"
Piotr Szotkowski about "Bits of ruby"
 
Τα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την PythonΤα Πολύ Βασικά για την Python
Τα Πολύ Βασικά για την Python
 

Mehr von SamQuiDaiBo (20)

Test
TestTest
Test
 
T3
T3T3
T3
 
T2
T2T2
T2
 
Bai Tap Thuc Hanh Javascript
Bai Tap Thuc Hanh JavascriptBai Tap Thuc Hanh Javascript
Bai Tap Thuc Hanh Javascript
 
Hangman Game
Hangman GameHangman Game
Hangman Game
 
Session 10 Final
Session 10 FinalSession 10 Final
Session 10 Final
 
Session 09 Final
Session 09 FinalSession 09 Final
Session 09 Final
 
Session 08 Final
Session 08 FinalSession 08 Final
Session 08 Final
 
Session 07 Final
Session 07 FinalSession 07 Final
Session 07 Final
 
Session 06 Final
Session 06 FinalSession 06 Final
Session 06 Final
 
Session 04 Final Sua
Session 04 Final SuaSession 04 Final Sua
Session 04 Final Sua
 
Session 03 Final
Session 03 FinalSession 03 Final
Session 03 Final
 
Session 02 Final
Session 02 FinalSession 02 Final
Session 02 Final
 
Session 01 Final
Session 01 FinalSession 01 Final
Session 01 Final
 
Html overview
Html overviewHtml overview
Html overview
 
Ittlgc1
Ittlgc1Ittlgc1
Ittlgc1
 
Ittlgc
IttlgcIttlgc
Ittlgc
 
Baitap C
Baitap CBaitap C
Baitap C
 
Epc Assigment2
Epc Assigment2Epc Assigment2
Epc Assigment2
 
Epc Assignment1
Epc Assignment1Epc Assignment1
Epc Assignment1
 

Kürzlich hochgeladen

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104misteraugie
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAssociation for Project Management
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDThiyagu K
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 

Kürzlich hochgeladen (20)

BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104Nutritional Needs Presentation - HLTH 104
Nutritional Needs Presentation - HLTH 104
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
APM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across SectorsAPM Welcome, APM North West Network Conference, Synergies Across Sectors
APM Welcome, APM North West Network Conference, Synergies Across Sectors
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Measures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SDMeasures of Dispersion and Variability: Range, QD, AD and SD
Measures of Dispersion and Variability: Range, QD, AD and SD
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 

Test5

  • 1. BÀI TRẮC NGHIỆM SỐ 4 Ngôn ngữ lập trình C Thời gian: 15’ Họ tên:……………………………………… Lớp………………………………………….. Câu 1: Trong C, hàm nào sau đây được dùng để giải phóng bộ nhớ đã được cấp phát? a. free b. delete c. clear d. remove Câu 2: Trong C, khai báo nào dưới đây là khai báo đúng của struct? a. struct{int a;} b. stuct a_struct{int;} c. struct a_struct int a; d. struct a_struct{int a;}; Câu 3: Trong C, đối số argc (argument count) lưu trữ giá trị gì? a. Số đối số truyền vào trong hàm main b. Số lượng đối số truyền vào trong hàm main + 1 c. Số lượng đối số truyền vào trong hàm main -1 d. Tổng kích thước tính bằng byte của mảng đối số Câu 4: Cho đoạn chương trình C sau đây: int a[10], i, *p; a[0] = 1; a[1] = 2; p = a; (*p)++; a[1]=? a. a[1] = 2 b. a[1] = 3 c. a[1] = 4 d. Không đưa ra kết quả. Câu 5: Thực hiện: Kiểm tra nếu a, b, c đều lớn hơn 1 thì in số 1, chọn câu nào? a. if (a>1) or (b>1) or (c>1) then write(1); b. if a>1 and b>1 and c>1 then write(1); c. if (a>1) and (b>1) and (c>1) then write(1); d. if a, b, c > 1 then write(1); Câu 6: Đáp án nào dưới đây là khai báo hoàn chỉnh của một hàm trong C? a. int funct(); b. int funct(int x) {return x=x+1;} c. void funct(int) {printf(quot;Helloquot;)} d. void funct(x) { printf(quot;Helloquot;)} Câu 7:Chỉ thị nào sau đây là đúng khi sử dụng để khai báo một mảng 10 ký tự có tên letters? a) letters: char[10]; b) char[10] letters; c) char letters[10]; d) char array letters[10]; Câu 8: Câu lệnh nào sau đây là đúng khi gán ký tự ‘Z’ cho phần tử thứ tư của mảng letters? a) letters[4]:= “Z”; b) letters[3] = 'Z'; c) letters[4] = quot;Zquot;; d) letters[3] = 'z';
  • 2. Câu 9: Chỉ thị nào sau đây là đúng khi khai báo mảng hai chiều balances có 3 hàng và 5 cột? a) float balances[3][5]; b) balances[3][5] of float; c) float balances[5][3]; d) array of float balances[0..2][0..5]; Câu 10: Câu lệnh nào sau đây là đúng để gán xâu “Hello” cho mảng ký tự words tại thời điểm khai báo? a) char words[10] = 'Hello'; b) static char words[] = quot;Helloquot;; c) static char words[quot;helloquot;]; d) static char words[] = { Hello }; Câu 11: Câu lệnh nào sau đây là đúng để gán xâu “Welcome” cho xâu ký tự stuff? a) strcpy( stuff, 'Welcome' ); b) stuff = quot;Welcomequot;; c) stuff[0] = quot;Welcomequot;; d) strcpy(stuff, quot;Welcomequot; ); Câu 12 Câu lệnh nào sau đây là đúng để in ra màn hình giá trị của phần tử thứ 3 của mảng số nguyên có tên totals? a) printf(quot;%dnquot;, &totals[3] ); b) printf(quot;%dnquot;, totals[3] ); c) printf(quot;%cnquot;, totals[2] ); d) printf(quot;%dnquot;, totals[2] ); Câu 13: Câu lệnh nào sau đây là đúng để in ra màn hình xâu ký tự có tên words? a) printf(quot;%snquot;, words); b) printf(quot;%cnquot;, words); c) printf(quot;%dnquot;, words); d) printf(quot;%snquot;, words[2]); Câu 14: Câu lệnh nào sau đây là đúng để nhập vào giá trị cho xâu ký có tên words từ bàn phím? a) scanf(quot;%snquot;, words); b) scanf(quot; %cquot;, words); c) scanf(quot;%cquot;, words); d) scanf(quot;%squot;, words); Câu 15: Chỉ thị nào sao đây là đúng để khai báo một biến con trỏ nguyên có tên address? a) int address; b) address *int; c) int *address; d) *int address; Câu 16: Câu lệnh nào sau đây là đúng khi gán địa chỉ của biến thực balance cho con trỏ thực temp? a) temp = &balance; b) balance = float temp; c) float temp *balance; d) &temp = balance;
  • 3. Câu 17: Câu lệnh nào sau đây là đúng khi sử dụng để gán ký tự ‘W’ cho biến ký tự được trỏ bởi biến con trỏ ký tự letter? a) 'W' = *letter; b) letter = quot;Wquot;; c) letter = *W; d) *letter = 'W'; Câu 18: Cho biết kết quả trên màn hình sau khi chạy đoạn chương trình sau? int count = 10, *temp; sum = 0; temp = &count; *temp = 20; temp = ∑ *temp = count; printf(quot;count = %d, *temp = %d, sum = %dnquot;, count, *temp, sum ); a) count = 2, *temp = 10, sum = 10 b) count = 20, *temp = 20, sum = 20 c) count = 10, *temp = 2, sum = 10 d) count = 200, *temp = 0.2, sum = 1 Câu 19: Chỉ thị nào sau đây là đúng khi khai báo một con trỏ trỏ vào xâu “Hello” có tên message? a) char message = quot;Helloquot;; b) *message = quot;Helloquot;; c) char *message = quot;Helloquot;; d) char message = 'Hello'; Câu 20: Trong ngôn ngữ C, câu lệnh nào sau đây trả về địa chỉ ô nhớ của con trỏ p? a. p; b. *p; c. &p; d. address(p);