CS201- Introduction to Programming Current Quizzes

Similar documents
CS201 Latest Solved MCQs

Quiz Start Time: 09:34 PM Time Left 82 sec(s)

Lecture 14. No in-class files today. Homework 7 (due on Wednesday) and Project 3 (due in 10 days) posted. Questions?

FORM 2 (Please put your name and form # on the scantron!!!!)

Pointers, Dynamic Data, and Reference Types

For Teacher's Use Only Q No Total Q No Q No

Collected By Anonymous

Dynamic Allocation of Memory

Homework #3 CS2255 Fall 2012

CS201 Some Important Definitions

Exam 3 Chapters 7 & 9

Come and join us at WebLyceum

Short Notes of CS201


CS201 - Introduction to Programming Glossary By

Pointer Data Type and Pointer Variables

Object Oriented Programming. Solved MCQs - Part 2

COMPUTER APPLICATION

IS0020 Program Design and Software Tools Midterm, Fall, 2004

C++ PROGRAMMING LANGUAGE: DYNAMIC MEMORY ALLOCATION AND EXCEPTION IN C++. CAAM 519, CHAPTER 15

CA31-1K DIS. Pointers. TA: You Lu

In Java we have the keyword null, which is the value of an uninitialized reference type

Pointers. 1 Background. 1.1 Variables and Memory. 1.2 Motivating Pointers Massachusetts Institute of Technology

CS2141 Software Development using C/C++ C++ Basics

Pointers review. int a = 5; int *ptr = &a; cout << *ptr;

KOM3191 Object Oriented Programming Dr Muharrem Mercimek OPERATOR OVERLOADING. KOM3191 Object-Oriented Programming

Come and join us at WebLyceum

CS162 - POINTERS. Lecture: Pointers and Dynamic Memory

CSI33 Data Structures

Discussion 1E. Jie(Jay) Wang Week 10 Dec.2

Dynamic Allocation in C

FORM 1 (Please put your name and section number (001/10am or 002/2pm) on the scantron!!!!) CS 161 Exam II: True (A)/False(B) (2 pts each):

CS107 Handout 08 Spring 2007 April 9, 2007 The Ins and Outs of C Arrays

Arrays and Pointers. CSE 2031 Fall November 11, 2013

Exercise: Inventing Language

Final exam. Final exam will be 12 problems, drop any 2. Cumulative up to and including week 14 (emphasis on weeks 9-14: classes & pointers)

COMP 2355 Introduction to Systems Programming

CS2351 Data Structures. Lecture 7: A Brief Review of Pointers in C

Name :. Roll No. :... Invigilator s Signature : INTRODUCTION TO PROGRAMMING. Time Allotted : 3 Hours Full Marks : 70

Object Reference and Memory Allocation. Questions:

Declaring Pointers. Declaration of pointers <type> *variable <type> *variable = initial-value Examples:

double d0, d1, d2, d3; double * dp = new double[4]; double da[4];

Review of the C Programming Language for Principles of Operating Systems

CS 161 Exam II Winter 2018 FORM 1

Arrays, Pointers and Memory Management

Arrays and Pointers. Arrays. Arrays: Example. Arrays: Definition and Access. Arrays Stored in Memory. Initialization. EECS 2031 Fall 2014.

Object Oriented Software Design II

C++_ MARKS 40 MIN

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

CS 31: Intro to Systems Pointers and Memory. Kevin Webb Swarthmore College October 2, 2018

CSCE 206: Structured Programming in C++

CSCE 206: Structured Programming in C++

calling a function - function-name(argument list); y = square ( z ); include parentheses even if parameter list is empty!

STUDY NOTES UNIT 1 - INTRODUCTION TO OBJECT ORIENTED PROGRAMMING

Arrays and Pointers (part 2) Be extra careful with pointers!

Dynamic Allocation in C

CS 31: Intro to Systems Pointers and Memory. Martin Gagne Swarthmore College February 16, 2016

Arrays and Pointers (part 2) Be extra careful with pointers!

Object Oriented Pragramming (22316)

Programming. Pointers, Multi-dimensional Arrays and Memory Management

Pointers. A pointer value is the address of the first byte of the pointed object in the memory. A pointer does not know how many bytes it points to.

Algorithms & Data Structures

Pointers and Dynamic Memory Allocation

Tokens, Expressions and Control Structures

7.1 Optional Parameters

Pointer Basics. Lecture 13 COP 3014 Spring March 28, 2018

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

Arrays. Returning arrays Pointers Dynamic arrays Smart pointers Vectors

Fall 2018 Discussion 2: September 3, 2018

Pointers and Arrays CS 201. This slide set covers pointers and arrays in C++. You should read Chapter 8 from your Deitel & Deitel book.

CS 162, Lecture 25: Exam II Review. 30 May 2018

CS2255 HOMEWORK #1 Fall 2012

Padasalai.Net s Model Question Paper

CS201- Introduction to Programming Latest Solved Mcqs from Midterm Papers May 07,2011. MIDTERM EXAMINATION Spring 2010

LSN 3 C Concepts for OS Programming

Dynamic Allocation of Memory

C++ 8. Constructors and Destructors

EMBEDDED SYSTEMS PROGRAMMING Language Basics

Array. Prepared By - Rifat Shahriyar

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

Technical Questions. Q 1) What are the key features in C programming language?

Motor Industry Software Reliability Association (MISRA) C:2012 Standard Mapping of MISRA C:2012 items to Goanna checks

QUIZ. 1. Explain the meaning of the angle brackets in the declaration of v below:

Object Oriented Design

M1-R4: Programing and Problem Solving using C (JAN 2019)

Increases Program Structure which results in greater reliability. Polymorphism

Course Text. Course Description. Course Objectives. StraighterLine Introduction to Programming in C++

Dynamic memory allocation (malloc)

Multiple Choice (Questions 1 14) 28 Points Select all correct answers (multiple correct answers are possible)

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

B.V. Patel Institute of Business Management, Computer & Information Technology, Uka Tarsadia University

Kurt Schmidt. October 30, 2018

Object-Oriented Principles and Practice / C++

! The address operator (&) returns the address of a. ! Pointer: a variable that stores the address of another

Review of the C Programming Language

cout << "How many numbers would you like to type? "; cin >> memsize; p = new int[memsize];

M1-R4: Programing and Problem Solving using C (JULY 2018)

CS250 Final Review Questions

! Determine if a number is odd or even. ! Determine if a number/character is in a range. - 1 to 10 (inclusive) - between a and z (inclusive)

LECTURE 03 LINKED LIST

Transcription:

CS201- Introduction to Programming Current Quizzes Q.1 char name [] = Hello World ; In the above statement, a memory of characters will be allocated 13 11 12 (Ans) Q.2 A function is a block of statements that can be defined once and used in the program. one time 2 time three time as many times as user wants (Ans) Q.3 What will be the size of following array? int arr[29] 0 30 (Ans) 29 28 Q.4 Which of the following function call is call by reference for the following function prototype? int add (int *) add(&x); (Ans) add(int x); add(x); add(*x); Q.5 ----------- statement is used to terminate the processing of a particular case and exit from switch structure. if goto break (Ans) continue Q.6 will be used for enclosing function statements into a block. "" () []

{} (Ans) Q.7 Default mechanism of calling a function by passing it array is call by and in case of passing variable is call by Reference, Reference Reference, value (Ans) Value, Reference Value, Value Q. 8 What is the output of the following code, if the first case is true switch (var) { case a : cout apple endl; case b : cout banana endl; case m : cout mango endl; default: cout any fruit endl; } apple anyfruit apple banana mango* none of above apple only? Q.9 Functions declared with the specifier in a class member list are called friend functions of that class. protected private public friend Q.10 Public or private keywords can be written only for once in the class or structure declaration written multiple times in the class or structure declaration written only twice in the class declaration written outside the class Q.11 Good practice is to write public or private keywords only once in the class or structure declaration, though there is no syntactical or logical problem in writing them multiple times. The friend keyword provides access. in one direction only in two directions to all classes to the data members of the friend class only

Q.12 References cannot be uninitialized. Because it is impossible to reinitialize a pointer reinitialize a reference initialize a NULL pointer cast a pointer Q.13 new operator can be used for. only integer data type only char and integer data types integer, float, char and double data types dot operator Q.14 The destructor is used to. allocate memory deallocate memory create objects allocate static memory Q.15 Reference is not really an address it is. a synonym an antonym a value a number Q.16 If we want to allocate memory to an array of 5 integers dynamically, the syntax will be. int *iptr ; iptr = new int[5] ; integer iptr** ; iptr= new int[5] int iptr ; iptr= int [5] iptr= new[5] Q.17 Memory allocated from heap or free store. can be returned back to the system automatically can be allocated to classes only cannot be returned back unless freed explicitly using malloc and realloc cannot be returned back unless freed explicitly using free and delete operators

Q.18 Operator overloading is to allow the same operator to be bound to more than one implementation, depending on the types of the. Compilers Operands Function names Applications Q. 19 The operator to free the allocated memory using new operator is. free del delete remove Q.20 To read command-line arguments, the main() function itself must be given arguments a. 1 b. 2 ANS c. 3 d. 4 Q.21 Returns true if c is a digit or a letter and false otherwise. a. int isalnum( int c ) ANS b. int isalpha( int c ) c. int isxdigit( int c ) Q.22 The increment of a pointer depends on its. a. data type ANS b. value c. variable Q.23 dereferencing operator is represented by a. + b. * ANS c. &

Q.24 There is a pointer variable named ptr of type float then address of which type of variable the ptr will store in it? a. int b. float. ANS c. double. Q.25 suppose we have int y[10]; To access the 4th element of the array we write a. y[4] b. y[3] ANS c. y(4) Q.26 Given a two dimensional array of integers, what would be the correct way of assigning the value 6 to the element at third row and fourth column? a. array[2][4] = 6 ; b. array[3][4] = 6 ; c. array[2][3] = 6 ; ANS Q.27 At the, we try to break up the problem into functional units 1 design phase ANS 2 Implementation phase 3 analysis phase 4 None of the given