SlideShare una empresa de Scribd logo
1 de 13
Descargar para leer sin conexión
2010
http://www.psExam.com
Suresh Khanal




[C++ MULTIPLE CHOICE
  QUESTIONS BANK]
This is the first set of the series of C++ Multiple Choice
Question Bank. I have presented selected 25 questions
and the correct answers are at the end.
Dear fellow students,
As a better way of distributing study
materials, I have started to publish in pdf
documents and let you download or send it
through email.
Here I present the first set of C/C++ Multiple
Choice Questions and the Answers. Hope this
will be helpful to your preparation of
Computer Science Exam.
I heartily welcome to distribute your eBooks
or Papers if you have any and wish to share
them. I believe you understand the value of
sharing.
Sharing Enriches!


Suresh Khanal
Admin
http://www.psexam.com


  Contact: Suresh Khanal Email: shkhanal@gmail.com   Blog: http://www.ictTrends.com
Multiple Choice Questions
      Programming Language
              and
             C/C++




Contact: Suresh Khanal Email: shkhanal@gmail.com   Blog: http://www.ictTrends.com
http://www.psExam.com                        1
                                                      C++ Multiple Choice Questions Bank



Question 1:
The break statement is used to exit from
  a. a DO loop
  b. a FOR loop
  c. a SWITCH statement
  d. all of above
  e. none of above


Question 2:
In which statements, does a CONTINUE statement cause the control to go
directly to the test condition and then continue the looping process?
  a. FOR and WHILE
  b. WHILE and IF-ELSE
  c. DO-WHILE and IF-ELSE
  d. While and DO-WHILE
  e. None of above


Question 3:
The advantage of a SWITCH statement over an ELSE-IF statement
  a. A default condition can be used in the SWITCH
  b. The SWITCH is easier to understand
  c. Several different condition can cause one set of statements to be executed in
      a SWITCH
  d. Several different statements can be executed in a SWITCH
  e. None of above




   Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com
http://www.psExam.com                      2
                                                      C++ Multiple Choice Questions Bank


Question No 4
The comma operator (,) is primarily used in conjunction with
  FOR statement
     IF-ELSE statement
     DO-While statement
  d. All of above
  e. None of above


Question No 5
The GOTO statement is used to
  a. Permit two different expressions to appear in situation where only one
      expression would ordinarily used
  b. Terminate loops or to exit from a switch
  c. Alter the normal sequence or program execution by transferring control to
      some other part of the program
  d. Carry out a logical test and then take one of two possible actions, depending
      upon the outcome of a test
  e. None of above


Question No 6
  a. The CONTINUE statement is used to
  b. Permit two different expressions to appear in situation where only one
      expression would ordinarily be used
  c. Terminate loops or exit from a switch
  d. Alter the normal sequence of program execution by transforming control to
      some other part of the program
  e. All of above
  f. None of above


   Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com
http://www.psExam.com                      3
                                                      C++ Multiple Choice Questions Bank


Question No 7
The traditional way to create an infinite loop in C is
   a. FOR ( ; ; )…
   b. IF (=) BREAK;
   c. WHILE ()…
   d. All of above
   e. None of above


Question No 8
The difference between the declaraction of an external variable and its
definition is
   a. A declaration causes storage space to be allocated to variable while a
       definition announces variable’s properties
   b. A declaration announces the properties of a variable while a definition also
       causes storage to be allocated
   c. A declaration announces the properties of a variable while definition only
       causes storage to be allocated
   d. A declaration uses storage space to be allocated to variable while a definition
       also announce its properties.
   e. None of above


Question No 9
The comma operator (,) is used to
   a. Permit to different expressions to appear in situation where only one
       expression would ordinarily be used
   b. Terminate loops or to exit from switch
   c. Alter the normal sequence of program execution by transferring control to
       some other parts of the program


   Contact: Suresh Khanal Email: shkhanal@gmail.com     Blog: http://www.ictTrends.com
http://www.psExam.com                      4
                                                      C++ Multiple Choice Questions Bank

   d. Carry out the logical test and then take one of two possible actions, depending
       upon the outcome of the test
   e. None of above


Question No 10
The recursive form of algebraic formula
y=(x1 + x2 + …+xn) is
   a. Y = x + n-1 xi i=1
   b. Y= xn + n xi i=1
   c. Y=xn+xi
   d. Y = xn + n-1 i=1 xi
   e. None of above


Question No 11
Which one of the following, is a storage class specification in C?
   a. Automatic
   b. External
   c. Static
   d. All of above
   e. None of above


Question No 12
Given these variables

char ch;
short i;
unsigned long ul;
float f;

   Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com
http://www.psExam.com                        5
                                                      C++ Multiple Choice Questions Bank

The overall type of this expression is
   a. Char
   b. Unsigned
   c. Float
   d. Double
   e. None of above


Question No 13
What will this program display?

#include <stdio.h>
main()
{
float f;
f=10/3;
printf ("%f",f);
}
      a. 3.3
      b. 3.0
      c. 3
      d. 3.1
      e. None of above


Question No 14
The most common use of the one-dimentional array in C is the
   a. String
   b. Character
   c. Data
   d. Functions

   Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com
http://www.psExam.com                        6
                                                      C++ Multiple Choice Questions Bank

   e. None of above


Question No 15
The string related function supplied by C standard library is
   a. strcpy()
   b. strcat()
   c. strcmp()
   d. All of above
   e. None of above


Question No 16
Find out the incorrect statement for strlen() function
   a. Returns the length of a string
   b. Does not count the null terminator
   c. Has general form strlen();
   d. All of above
   e. None of above


Question No 17
C provides loop constructs for performing loop operations. They are
   a. The WHILE statement
   b. The DO statement
   c. The FOR statement
   d. All of above
   e. None of above




   Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com
http://www.psExam.com                       7
                                                       C++ Multiple Choice Questions Bank


Question No 18
Arrays that do not have their dimensions explicitly specified are called
   a. Unsized arrays
   b. Undimensional arrays
   c. Initialized arrays
   d. No size of arrays
   e. None of above


Question No 19
What is wrong with the given fragment?
   a. The size of the array is not specified
   b. Declaration must have float in place of int
   c. The list must be enclosed between curly braces
   d. All of the above
   e. None of the above.


Question No 20
A variable that holds the memory address of another object is called a
   a. integer
   b. pointer
   c. constant
   d. memory variable
   e. None of the above.


Question No 21
C contains two special pointer operators:

   Contact: Suresh Khanal Email: shkhanal@gmail.com     Blog: http://www.ictTrends.com
http://www.psExam.com                       8
                                                       C++ Multiple Choice Questions Bank

   a. * and &
   b. * and &&
   c. & and &&
   d. % and &
   e. None of the above.


Question No 22
In C, the address of m's memory location can determined by the
expression
   a. *m
   b. m&
   c. &m
   d. m*
   e. None of the above.


Question No 23
Main() is an example of
   a. library function
   b. user-defined function
   c. header
   d. statement
   e. None of the above,


Question No 24
The header file 'ctype.h' can be used for
   a. providing links to assembly language for calls
   b. providing diagnostic and debugging assistance

   Contact: Suresh Khanal Email: shkhanal@gmail.com     Blog: http://www.ictTrends.com
http://www.psExam.com                        9
                                                       C++ Multiple Choice Questions Bank

  c. providing support for string handling functions
  d. providing character type identification (boolean) and translation
  e. None of the above.


Question No 25.
The header file 'math.h* can be used for
  a. providing links to assembly language for calls
  b. providing diagnostic and debugging assistance
  c. providing support for string handling functions
  d. All of the above
  e. None of the above.




   Contact: Suresh Khanal Email: shkhanal@gmail.com     Blog: http://www.ictTrends.com
http://www.psExam.com                      10
                                                        C++ Multiple Choice Questions Bank


Answers:
1. (d)        2. (d)       3. (b)       4. (a)          5. (d)         6. (c)

7. (a)        8. (a)       9. (6)       10. (d)         11. (a)        12. (c)

13. (a)       14. (c)      15. (e)      16. (a)         17. (b)        18. (a)

19. (d)       20. (d)      21. (c)      22. (b)         23. (a)        24. (d)

25. (e)




ICT Trends
A blog about blogging and bloggers. Wish to start your own blog? Do not
repeat the mistakes I have already made. Learn from my experiences and
save your time. Start blogging effectively and be a good blogger. You’ll
find about creating, promoting and monetizing blogs, SEO tips and tricks
and so on.




 MAIL TO shkhanal@gmail.com TO INCLUDE YOUR ADVERTISEMENT
             IN EBOOKS PUBLISHED FROM PS EXAM




     Contact: Suresh Khanal Email: shkhanal@gmail.com    Blog: http://www.ictTrends.com

Más contenido relacionado

Último

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin ClassesCeline George
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxcallscotland1987
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
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
 
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
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxAmita Gupta
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxVishalSingh1417
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...christianmathematics
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsMebane Rash
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 

Último (20)

Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Dyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptxDyslexia AI Workshop for Slideshare.pptx
Dyslexia AI Workshop for Slideshare.pptx
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
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...
 
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...
 
Third Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptxThird Battle of Panipat detailed notes.pptx
Third Battle of Panipat detailed notes.pptx
 
Unit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptxUnit-V; Pricing (Pharma Marketing Management).pptx
Unit-V; Pricing (Pharma Marketing Management).pptx
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
Explore beautiful and ugly buildings. Mathematics helps us create beautiful d...
 
On National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan FellowsOn National Teacher Day, meet the 2024-25 Kenan Fellows
On National Teacher Day, meet the 2024-25 Kenan Fellows
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 

Destacado

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...DevGAMM Conference
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationErica Santiago
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellSaba Software
 

Destacado (20)

Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 
ChatGPT webinar slides
ChatGPT webinar slidesChatGPT webinar slides
ChatGPT webinar slides
 
More than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike RoutesMore than Just Lines on a Map: Best Practices for U.S Bike Routes
More than Just Lines on a Map: Best Practices for U.S Bike Routes
 
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
Ride the Storm: Navigating Through Unstable Periods / Katerina Rudko (Belka G...
 
Barbie - Brand Strategy Presentation
Barbie - Brand Strategy PresentationBarbie - Brand Strategy Presentation
Barbie - Brand Strategy Presentation
 
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them wellGood Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
Good Stuff Happens in 1:1 Meetings: Why you need them and how to do them well
 

Mcq c plus_plus_first_set

  • 1. 2010 http://www.psExam.com Suresh Khanal [C++ MULTIPLE CHOICE QUESTIONS BANK] This is the first set of the series of C++ Multiple Choice Question Bank. I have presented selected 25 questions and the correct answers are at the end.
  • 2. Dear fellow students, As a better way of distributing study materials, I have started to publish in pdf documents and let you download or send it through email. Here I present the first set of C/C++ Multiple Choice Questions and the Answers. Hope this will be helpful to your preparation of Computer Science Exam. I heartily welcome to distribute your eBooks or Papers if you have any and wish to share them. I believe you understand the value of sharing. Sharing Enriches! Suresh Khanal Admin http://www.psexam.com Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 3. Multiple Choice Questions Programming Language and C/C++ Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 4. http://www.psExam.com 1 C++ Multiple Choice Questions Bank Question 1: The break statement is used to exit from a. a DO loop b. a FOR loop c. a SWITCH statement d. all of above e. none of above Question 2: In which statements, does a CONTINUE statement cause the control to go directly to the test condition and then continue the looping process? a. FOR and WHILE b. WHILE and IF-ELSE c. DO-WHILE and IF-ELSE d. While and DO-WHILE e. None of above Question 3: The advantage of a SWITCH statement over an ELSE-IF statement a. A default condition can be used in the SWITCH b. The SWITCH is easier to understand c. Several different condition can cause one set of statements to be executed in a SWITCH d. Several different statements can be executed in a SWITCH e. None of above Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 5. http://www.psExam.com 2 C++ Multiple Choice Questions Bank Question No 4 The comma operator (,) is primarily used in conjunction with FOR statement IF-ELSE statement DO-While statement d. All of above e. None of above Question No 5 The GOTO statement is used to a. Permit two different expressions to appear in situation where only one expression would ordinarily used b. Terminate loops or to exit from a switch c. Alter the normal sequence or program execution by transferring control to some other part of the program d. Carry out a logical test and then take one of two possible actions, depending upon the outcome of a test e. None of above Question No 6 a. The CONTINUE statement is used to b. Permit two different expressions to appear in situation where only one expression would ordinarily be used c. Terminate loops or exit from a switch d. Alter the normal sequence of program execution by transforming control to some other part of the program e. All of above f. None of above Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 6. http://www.psExam.com 3 C++ Multiple Choice Questions Bank Question No 7 The traditional way to create an infinite loop in C is a. FOR ( ; ; )… b. IF (=) BREAK; c. WHILE ()… d. All of above e. None of above Question No 8 The difference between the declaraction of an external variable and its definition is a. A declaration causes storage space to be allocated to variable while a definition announces variable’s properties b. A declaration announces the properties of a variable while a definition also causes storage to be allocated c. A declaration announces the properties of a variable while definition only causes storage to be allocated d. A declaration uses storage space to be allocated to variable while a definition also announce its properties. e. None of above Question No 9 The comma operator (,) is used to a. Permit to different expressions to appear in situation where only one expression would ordinarily be used b. Terminate loops or to exit from switch c. Alter the normal sequence of program execution by transferring control to some other parts of the program Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 7. http://www.psExam.com 4 C++ Multiple Choice Questions Bank d. Carry out the logical test and then take one of two possible actions, depending upon the outcome of the test e. None of above Question No 10 The recursive form of algebraic formula y=(x1 + x2 + …+xn) is a. Y = x + n-1 xi i=1 b. Y= xn + n xi i=1 c. Y=xn+xi d. Y = xn + n-1 i=1 xi e. None of above Question No 11 Which one of the following, is a storage class specification in C? a. Automatic b. External c. Static d. All of above e. None of above Question No 12 Given these variables char ch; short i; unsigned long ul; float f; Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 8. http://www.psExam.com 5 C++ Multiple Choice Questions Bank The overall type of this expression is a. Char b. Unsigned c. Float d. Double e. None of above Question No 13 What will this program display? #include <stdio.h> main() { float f; f=10/3; printf ("%f",f); } a. 3.3 b. 3.0 c. 3 d. 3.1 e. None of above Question No 14 The most common use of the one-dimentional array in C is the a. String b. Character c. Data d. Functions Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 9. http://www.psExam.com 6 C++ Multiple Choice Questions Bank e. None of above Question No 15 The string related function supplied by C standard library is a. strcpy() b. strcat() c. strcmp() d. All of above e. None of above Question No 16 Find out the incorrect statement for strlen() function a. Returns the length of a string b. Does not count the null terminator c. Has general form strlen(); d. All of above e. None of above Question No 17 C provides loop constructs for performing loop operations. They are a. The WHILE statement b. The DO statement c. The FOR statement d. All of above e. None of above Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 10. http://www.psExam.com 7 C++ Multiple Choice Questions Bank Question No 18 Arrays that do not have their dimensions explicitly specified are called a. Unsized arrays b. Undimensional arrays c. Initialized arrays d. No size of arrays e. None of above Question No 19 What is wrong with the given fragment? a. The size of the array is not specified b. Declaration must have float in place of int c. The list must be enclosed between curly braces d. All of the above e. None of the above. Question No 20 A variable that holds the memory address of another object is called a a. integer b. pointer c. constant d. memory variable e. None of the above. Question No 21 C contains two special pointer operators: Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 11. http://www.psExam.com 8 C++ Multiple Choice Questions Bank a. * and & b. * and && c. & and && d. % and & e. None of the above. Question No 22 In C, the address of m's memory location can determined by the expression a. *m b. m& c. &m d. m* e. None of the above. Question No 23 Main() is an example of a. library function b. user-defined function c. header d. statement e. None of the above, Question No 24 The header file 'ctype.h' can be used for a. providing links to assembly language for calls b. providing diagnostic and debugging assistance Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 12. http://www.psExam.com 9 C++ Multiple Choice Questions Bank c. providing support for string handling functions d. providing character type identification (boolean) and translation e. None of the above. Question No 25. The header file 'math.h* can be used for a. providing links to assembly language for calls b. providing diagnostic and debugging assistance c. providing support for string handling functions d. All of the above e. None of the above. Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com
  • 13. http://www.psExam.com 10 C++ Multiple Choice Questions Bank Answers: 1. (d) 2. (d) 3. (b) 4. (a) 5. (d) 6. (c) 7. (a) 8. (a) 9. (6) 10. (d) 11. (a) 12. (c) 13. (a) 14. (c) 15. (e) 16. (a) 17. (b) 18. (a) 19. (d) 20. (d) 21. (c) 22. (b) 23. (a) 24. (d) 25. (e) ICT Trends A blog about blogging and bloggers. Wish to start your own blog? Do not repeat the mistakes I have already made. Learn from my experiences and save your time. Start blogging effectively and be a good blogger. You’ll find about creating, promoting and monetizing blogs, SEO tips and tricks and so on. MAIL TO shkhanal@gmail.com TO INCLUDE YOUR ADVERTISEMENT IN EBOOKS PUBLISHED FROM PS EXAM Contact: Suresh Khanal Email: shkhanal@gmail.com Blog: http://www.ictTrends.com