SlideShare une entreprise Scribd logo
1  sur  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);

Contenu connexe

En vedette

En vedette (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
 

Similaire à 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
 

Similaire à 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
 

Plus de 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
 

Dernier

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxUmeshTimilsina1
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxPooja Bhuva
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxPooja Bhuva
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxannathomasp01
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxPooja Bhuva
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...ZurliaSoop
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 

Dernier (20)

Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Plant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptxPlant propagation: Sexual and Asexual propapagation.pptx
Plant propagation: Sexual and Asexual propapagation.pptx
 
Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024Mehran University Newsletter Vol-X, Issue-I, 2024
Mehran University Newsletter Vol-X, Issue-I, 2024
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptxOn_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
On_Translating_a_Tamil_Poem_by_A_K_Ramanujan.pptx
 
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptxExploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
Exploring_the_Narrative_Style_of_Amitav_Ghoshs_Gun_Island.pptx
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
Interdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptxInterdisciplinary_Insights_Data_Collection_Methods.pptx
Interdisciplinary_Insights_Data_Collection_Methods.pptx
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 

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);