SlideShare ist ein Scribd-Unternehmen logo
1 von 7
C++
Question #1
 What number of digits that can be accuratly stored in a float (based on
the IEEE Standard 754)?
a) 6
b) 38
c) An unlimited number
Answer: A
Question #2
 Which of the following is evaluated first:
a) &&
b) ||
c) !
Answer: C
Question #3
 What does 7/9*9 equal (in C and C++)?
a) 1
b) 0.08642
c) 0
Answer: C
Question #4
 Which is not valid in C?
a) class aClass{public:int x;};
b) /* A comment */
c) char x=12;
Answer: A
Question #5
 Which of the following is not a valid declaration for main()?
a) int main()
b) int main(int argc, char *argv[])
c) They both work
Answer: C
Question #6
 Evaluate as true or false: !(1 &&0 || !1)
a) True
b) False
c) Invalid statement
Answer: A
Question #7
 Which command properly allocates memory?
a) char *a=new char[20];
b) char a=new char[20];
c) char a=new char(20.0);
Answer: A
Question #8
 What operator is used to access a struct through a pointer?
a) ->
b) >>
c) *
Answer: C
Question #9
 Which is not an ANSII C++ function?
a) sin()
b) kbhit()
c) tmpnam()
Answer: B
Question #10
 True or false, if you keep incrementing a variable, it will become
negative?
a) True
b) False
c) It depends...
Answer: C
Question #11
 What character terminates all character array strings
a) 0
b) .
c) END
Answer: A
Question #12
 If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops
out first?
a) 5
b) 1
c) 3
Answer: A
Question #13
 What does strcat(an_array, "This"); do?
a) Copies "This" into an_array
b) Adds "This" to the end of an_array
c) Compares an_array and "This"
Answer: B
Question #14
 Evaluate:
int fn(int v)
{
if(v==1 || v==0)
return 1;
if(v%2==0)
return fn(v/2)+2;
else
return fn(v-1)+3;
}
for fn(7);
a) 10
b) 11
c) 1
Answer: B
Question #15
 Evalute the following: 22%5
a) 2
b) 4
c) 0
Answer: A
Question #16
 Which of the following data structures is on average the fastest for
retrieving data?
a) Binary Tree
b) Hash Table
c) Stack
Answer: B
Question #17
 What is the output:
int v()
{
int m=0;
return m++;
}
int main()
{
cout<<v();
}
a) 1
b) 0
c) Program is illegal
Answer: B
Question #18
 What does cout<<(0==0) print out?
a) 0
b) 1
c) Compiler error: Lvalue required
Answer: B
Question #19
 What is the maximum value of a unsigned char?
a) 255
b) 256
c) 128
Answer: A
Question #20
 Evaluate !(1&&1||1&&0)
a) Error
b) True
c) False
Answer: C
a) Error
b) True
c) False
Answer: C

Weitere ähnliche Inhalte

Ähnlich wie Ques c++ minhnd

C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdfchoconyeuquy
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professionalIsabella789
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxgitagrimston
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentspavan81088
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003ncct
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqssaadkhan672
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for Abhay Korat
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSESujata Regoti
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit isonalisraisoni
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answersSareen Kumar
 
Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programmingCHANDAN KUMAR
 
Gate Previous Years Papers It2005
Gate Previous Years Papers It2005Gate Previous Years Papers It2005
Gate Previous Years Papers It2005Rahul Jain
 

Ähnlich wie Ques c++ minhnd (20)

C multiple choice questions and answers pdf
C multiple choice questions and answers pdfC multiple choice questions and answers pdf
C multiple choice questions and answers pdf
 
1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional1z0 851 exam-java standard edition 6 programmer certified professional
1z0 851 exam-java standard edition 6 programmer certified professional
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
 
Gate-Cs 1999
Gate-Cs 1999Gate-Cs 1999
Gate-Cs 1999
 
this pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming studentsthis pdf very much useful for embedded c programming students
this pdf very much useful for embedded c programming students
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003
 
Ansi c
Ansi cAnsi c
Ansi c
 
Computer programming mcqs
Computer programming mcqsComputer programming mcqs
Computer programming mcqs
 
C MCQ
C MCQC MCQ
C MCQ
 
FSOFT - Test Java Exam
FSOFT - Test Java ExamFSOFT - Test Java Exam
FSOFT - Test Java Exam
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for
 
Technical aptitude test 2 CSE
Technical aptitude test 2 CSETechnical aptitude test 2 CSE
Technical aptitude test 2 CSE
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
 
Technical questions for interview c programming
Technical questions for interview  c programmingTechnical questions for interview  c programming
Technical questions for interview c programming
 
1
11
1
 
Midterm
MidtermMidterm
Midterm
 
Gate Previous Years Papers It2005
Gate Previous Years Papers It2005Gate Previous Years Papers It2005
Gate Previous Years Papers It2005
 
Technical questions
Technical questionsTechnical questions
Technical questions
 
Soln dc05
Soln dc05Soln dc05
Soln dc05
 

Kürzlich hochgeladen

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 

Kürzlich hochgeladen (20)

Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 

Ques c++ minhnd

  • 1. C++ Question #1  What number of digits that can be accuratly stored in a float (based on the IEEE Standard 754)? a) 6 b) 38 c) An unlimited number Answer: A Question #2  Which of the following is evaluated first: a) && b) || c) ! Answer: C Question #3  What does 7/9*9 equal (in C and C++)? a) 1 b) 0.08642 c) 0 Answer: C Question #4  Which is not valid in C? a) class aClass{public:int x;}; b) /* A comment */ c) char x=12; Answer: A Question #5  Which of the following is not a valid declaration for main()?
  • 2. a) int main() b) int main(int argc, char *argv[]) c) They both work Answer: C Question #6  Evaluate as true or false: !(1 &&0 || !1) a) True b) False c) Invalid statement Answer: A Question #7  Which command properly allocates memory? a) char *a=new char[20]; b) char a=new char[20]; c) char a=new char(20.0); Answer: A Question #8  What operator is used to access a struct through a pointer? a) -> b) >> c) * Answer: C Question #9  Which is not an ANSII C++ function?
  • 3. a) sin() b) kbhit() c) tmpnam() Answer: B Question #10  True or false, if you keep incrementing a variable, it will become negative? a) True b) False c) It depends... Answer: C Question #11  What character terminates all character array strings a) 0 b) . c) END Answer: A Question #12  If you push the numbers (in order) 1, 3, and 5 onto a stack, which pops out first? a) 5 b) 1 c) 3 Answer: A Question #13  What does strcat(an_array, "This"); do?
  • 4. a) Copies "This" into an_array b) Adds "This" to the end of an_array c) Compares an_array and "This" Answer: B Question #14  Evaluate: int fn(int v) { if(v==1 || v==0) return 1; if(v%2==0) return fn(v/2)+2; else return fn(v-1)+3; } for fn(7); a) 10 b) 11 c) 1 Answer: B Question #15  Evalute the following: 22%5 a) 2 b) 4 c) 0 Answer: A Question #16  Which of the following data structures is on average the fastest for retrieving data? a) Binary Tree b) Hash Table
  • 5. c) Stack Answer: B Question #17  What is the output: int v() { int m=0; return m++; } int main() { cout<<v(); } a) 1 b) 0 c) Program is illegal Answer: B Question #18  What does cout<<(0==0) print out? a) 0 b) 1 c) Compiler error: Lvalue required Answer: B Question #19  What is the maximum value of a unsigned char? a) 255 b) 256 c) 128 Answer: A Question #20  Evaluate !(1&&1||1&&0)
  • 6. a) Error b) True c) False Answer: C
  • 7. a) Error b) True c) False Answer: C