SlideShare a Scribd company logo
1 of 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

More Related Content

What's hot

Πλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
Πλάτων - Πολιτεία (Γ΄Λυκείου) - ΜεταφράσειςΠλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
Πλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
Olga Paizi
 
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμαφυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
Spiridon Rallis
 
Η οικονομική ζωή κατά την περίοδο 1922- 1936
Η  οικονομική ζωή κατά την περίοδο 1922- 1936Η  οικονομική ζωή κατά την περίοδο 1922- 1936
Η οικονομική ζωή κατά την περίοδο 1922- 1936
Vassiliki Yiannou
 
φυσικη γ γυμνασιου
φυσικη γ γυμνασιουφυσικη γ γυμνασιου
φυσικη γ γυμνασιου
HIOTELIS IOANNIS
 
Ολοκλήρωση εξισώσεων κίνησης
Ολοκλήρωση εξισώσεων κίνησηςΟλοκλήρωση εξισώσεων κίνησης
Ολοκλήρωση εξισώσεων κίνησης
John Fiorentinos
 

What's hot (9)

Πλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
Πλάτων - Πολιτεία (Γ΄Λυκείου) - ΜεταφράσειςΠλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
Πλάτων - Πολιτεία (Γ΄Λυκείου) - Μεταφράσεις
 
ΤΡΑΠΕΖΑ ΘΕΜΑΤΩΝ ΦΥΣΙΚΗΣ Α΄ΛΥΚΕΙΟΥ-ΘΕΜΑ Β-2ος+3ος ΝΟΜΟΣ ΝΕΥΤΩΝΑ
ΤΡΑΠΕΖΑ ΘΕΜΑΤΩΝ ΦΥΣΙΚΗΣ Α΄ΛΥΚΕΙΟΥ-ΘΕΜΑ Β-2ος+3ος ΝΟΜΟΣ ΝΕΥΤΩΝΑΤΡΑΠΕΖΑ ΘΕΜΑΤΩΝ ΦΥΣΙΚΗΣ Α΄ΛΥΚΕΙΟΥ-ΘΕΜΑ Β-2ος+3ος ΝΟΜΟΣ ΝΕΥΤΩΝΑ
ΤΡΑΠΕΖΑ ΘΕΜΑΤΩΝ ΦΥΣΙΚΗΣ Α΄ΛΥΚΕΙΟΥ-ΘΕΜΑ Β-2ος+3ος ΝΟΜΟΣ ΝΕΥΤΩΝΑ
 
Μέχρις_ότου - Σύγκριση με Όσο...επανάλαβε - Γενικές Παρατηρήσεις
Μέχρις_ότου - Σύγκριση με Όσο...επανάλαβε - Γενικές ΠαρατηρήσειςΜέχρις_ότου - Σύγκριση με Όσο...επανάλαβε - Γενικές Παρατηρήσεις
Μέχρις_ότου - Σύγκριση με Όσο...επανάλαβε - Γενικές Παρατηρήσεις
 
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμαφυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
φυσική γ΄γυμνασίου-2-ηλεκτρικό-ρεύμα
 
Νεοελληνική Γλώσσα Γ Γυμνασίου Ενότητα 6 Φύλλο εργασίας
Νεοελληνική Γλώσσα Γ Γυμνασίου Ενότητα 6 Φύλλο εργασίαςΝεοελληνική Γλώσσα Γ Γυμνασίου Ενότητα 6 Φύλλο εργασίας
Νεοελληνική Γλώσσα Γ Γυμνασίου Ενότητα 6 Φύλλο εργασίας
 
Η οικονομική ζωή κατά την περίοδο 1922- 1936
Η  οικονομική ζωή κατά την περίοδο 1922- 1936Η  οικονομική ζωή κατά την περίοδο 1922- 1936
Η οικονομική ζωή κατά την περίοδο 1922- 1936
 
φυσικη γ γυμνασιου
φυσικη γ γυμνασιουφυσικη γ γυμνασιου
φυσικη γ γυμνασιου
 
Ολοκλήρωση εξισώσεων κίνησης
Ολοκλήρωση εξισώσεων κίνησηςΟλοκλήρωση εξισώσεων κίνησης
Ολοκλήρωση εξισώσεων κίνησης
 
Εμπορική Ναυτιλία
Εμπορική ΝαυτιλίαΕμπορική Ναυτιλία
Εμπορική Ναυτιλία
 

Similar to Ques c++ minhnd

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
Pamidimukkala Sivani
 
ExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docxExamName___________________________________MULTIPLE CH.docx
ExamName___________________________________MULTIPLE CH.docx
gitagrimston
 
Ramco Sample Paper 2003
Ramco  Sample  Paper 2003Ramco  Sample  Paper 2003
Ramco Sample Paper 2003
ncct
 
Java Questioner for
Java Questioner for Java Questioner for
Java Questioner for
Abhay Korat
 
Data structures and algorithms unit i
Data structures and algorithms unit iData structures and algorithms unit i
Data structures and algorithms unit i
sonalisraisoni
 
100 c interview questions answers
100 c interview questions answers100 c interview questions answers
100 c interview questions answers
Sareen Kumar
 

Similar to Ques c++ minhnd (20)

(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2(Www.entrance exam.net)-tcs placement sample paper 2
(Www.entrance exam.net)-tcs placement sample paper 2
 
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdfLDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
LDCQ paper Dec21 with answer key_62cb2996afc60f6aedeb248c1d9283e5.pdf
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
important C questions and_answers praveensomesh
important C questions and_answers praveensomeshimportant C questions and_answers praveensomesh
important C questions and_answers praveensomesh
 
Cs101 endsem 2014
Cs101 endsem 2014Cs101 endsem 2014
Cs101 endsem 2014
 
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
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
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
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
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...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
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...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 

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