SlideShare a Scribd company logo
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);

More Related Content

Viewers also liked

Session 7 En
Session 7 EnSession 7 En
Session 7 En
SamQuiDaiBo
 
Accessibilité commerces
Accessibilité commercesAccessibilité commerces
Accessibilité commerces
publimotion
 
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 Mentonpublimotion
 
Session 05 Final
Session 05 FinalSession 05 Final
Session 05 FinalSamQuiDaiBo
 
Internet
InternetInternet

Viewers also liked (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
 

Similar to Test5

Pre-Cal 40S May 4, 2009
Pre-Cal 40S May 4, 2009Pre-Cal 40S May 4, 2009
Pre-Cal 40S May 4, 2009
Darren Kuropatwa
 
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
Buddy Brewer
 
aaaaaaaaaa
aaaaaaaaaaaaaaaaaaaa
aaaaaaaaaa
huongtra_2004
 
Bai Giang 11
Bai Giang 11Bai Giang 11
Bai Giang 11
nbb3i
 
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 Excel
trungtinh
 
Control flow in c
Control flow in cControl flow in c
Control flow in c
thirumalaikumar3
 
Bai tap dai_so_tuyen_tinh
Bai tap dai_so_tuyen_tinhBai tap dai_so_tuyen_tinh
Bai tap dai_so_tuyen_tinh
Informatics and Maths
 
Practica 3ro trips
Practica 3ro tripsPractica 3ro trips
Practica 3ro trips
Anabel Milagros Montes Miranda
 
深入淺出C語言
深入淺出C語言深入淺出C語言
深入淺出C語言
Simen Li
 
C++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & RangesC++20 新功能:Concepts & Ranges
C++20 新功能:Concepts & Ranges
Yongwei Wu
 
Vim your Python, Python your Vim
Vim your Python, Python your VimVim your Python, Python your Vim
Vim your Python, Python your Vim
Miroslav Šedivý
 
Boo Programming Language
Boo Programming LanguageBoo Programming Language
Boo Programming Language
Vitaly Baum
 
090608-TogoWS REST
090608-TogoWS REST090608-TogoWS REST
090608-TogoWS REST
ocha_kaneko
 
Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021Demystifying Unicode - Longhorn PHP 2021
Demystifying Unicode - Longhorn PHP 2021
Colin 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 .docx
kenjordan97598
 
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
Ashish 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
Τα Πολύ Βασικά για την Python
Moses Boudourides
 

Similar to 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
 

More from SamQuiDaiBo

Bai Tap Thuc Hanh Javascript
Bai Tap Thuc Hanh JavascriptBai Tap Thuc Hanh Javascript
Bai Tap Thuc Hanh JavascriptSamQuiDaiBo
 
Session 10 Final
Session 10 FinalSession 10 Final
Session 10 FinalSamQuiDaiBo
 
Session 09 Final
Session 09 FinalSession 09 Final
Session 09 FinalSamQuiDaiBo
 
Session 08 Final
Session 08 FinalSession 08 Final
Session 08 FinalSamQuiDaiBo
 
Session 07 Final
Session 07 FinalSession 07 Final
Session 07 FinalSamQuiDaiBo
 
Session 06 Final
Session 06 FinalSession 06 Final
Session 06 FinalSamQuiDaiBo
 
Session 04 Final Sua
Session 04 Final SuaSession 04 Final Sua
Session 04 Final SuaSamQuiDaiBo
 
Session 03 Final
Session 03 FinalSession 03 Final
Session 03 FinalSamQuiDaiBo
 
Session 02 Final
Session 02 FinalSession 02 Final
Session 02 Final
SamQuiDaiBo
 
Session 01 Final
Session 01 FinalSession 01 Final
Session 01 FinalSamQuiDaiBo
 

More from 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
 

Recently uploaded

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
RitikBhardwaj56
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
ak6969907
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
Dr. Mulla Adam Ali
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
mulvey2
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
Dr. Shivangi Singh Parihar
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
simonomuemu
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
Nguyen Thanh Tu Collection
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
amberjdewit93
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
Nicholas Montgomery
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
NgcHiNguyn25
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
David Douglas School District
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 

Recently uploaded (20)

The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...The simplified electron and muon model, Oscillating Spacetime: The Foundation...
The simplified electron and muon model, Oscillating Spacetime: The Foundation...
 
World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024World environment day ppt For 5 June 2024
World environment day ppt For 5 June 2024
 
Hindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdfHindi varnamala | hindi alphabet PPT.pdf
Hindi varnamala | hindi alphabet PPT.pdf
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptxC1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
C1 Rubenstein AP HuG xxxxxxxxxxxxxx.pptx
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.PCOS corelations and management through Ayurveda.
PCOS corelations and management through Ayurveda.
 
Smart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICTSmart-Money for SMC traders good time and ICT
Smart-Money for SMC traders good time and ICT
 
Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.Types of Herbal Cosmetics its standardization.
Types of Herbal Cosmetics its standardization.
 
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptxChapter 4 - Islamic Financial Institutions in Malaysia.pptx
Chapter 4 - Islamic Financial Institutions in Malaysia.pptx
 
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
BÀI TẬP BỔ TRỢ TIẾNG ANH 8 CẢ NĂM - GLOBAL SUCCESS - NĂM HỌC 2023-2024 (CÓ FI...
 
Digital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental DesignDigital Artefact 1 - Tiny Home Environmental Design
Digital Artefact 1 - Tiny Home Environmental Design
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Film vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movieFilm vocab for eal 3 students: Australia the movie
Film vocab for eal 3 students: Australia the movie
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
Life upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for studentLife upper-Intermediate B2 Workbook for student
Life upper-Intermediate B2 Workbook for student
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 
Pride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School DistrictPride Month Slides 2024 David Douglas School District
Pride Month Slides 2024 David Douglas School District
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 

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