CS201 - Introduction To Programming Final Term Solved Paper 2021

This is CS201 Final Term Past Paper l CS201 Final Term Solved Paper 2021 l CS201 Solved Final Term Paper 2021. We have provided this paper CS201 - Introduction To Programming Solved Final Term Past Paper 2021 l CS201 - Introduction To Programming Final Term Solved Paper 2021 By Raise For Success l CS201 - Introduction To Programming Current Solved Final Term Paper 2021. We tried our best to solve it if found any mistake then correct yourself.

Question No 1:
What will be the output (Raise For Success) of the following code segment?
Int arr[]={23,56,32,44, (Raise For Success) 55,3,6,88,99}
Int*ptr=&arr[2];
Cout<<*(ptr+4);
  • 6
  • 56 Correct
  • 32
  • 3

Question No 2:

To make any function as (Raise For Success) inline, declare it in a following way.

  • inline int fucntionname() Correct
  • int inline functionname()
  • int fucntionname inline()
  • functionname inline()

Question No 3:

_______ operator is used to return (Raise For Success) memory to free store, which was previously allocated by the new operator.

  • Remove
  • Return
  • Old
  • Delete Correct

Question No 4:

The declaration of Plus (+) member (Raise For Success) operator function is ______.

  • Class – Name operator + (Class – Name rhs) Correct
  • Operator Class – Name + ()
  • Operator Class – Name + (rhs)
  • Class – Name operator + ()

Question No 5:

*this is a pointer (Raise For Success) that always points to:

  • Current function of the class
  • Current pointer of the class
  • Current object of the class Correct
  • A value of data member



Question No 6:

If overload plus (+) operator is implemented as non-member function then which of the following statement will be true (Raise For Success) for the statement given below?

Obj3 = obj1 + obj2;

  • Obj2 will be passed as an argument to + operator whereas obj2 will drive the + operator
  • Obj1 will be drive the + operator whereas obj2 will be passed as an argument to + operator Correct
  • Both objects (obj1, obj2) will (Raise For Success) be passed as arguments to the + operator
  • Any of the objects (obj1, obj2) can drive the + operator

Question No 7:

In the statement (Raise For Success) int &x=y compiler ________.

  • Creates a new variable x in memory and assigns it value of variable y
  • Creates a new variable x and assigns it the address of variable y Correct
  • X is just a new name of variable y without creating a new variable in memory
  • Creates a new variable y in memory and assigns if value of variable x

Question No 8:

You ae required to choose the (Raise For Success) option which is the true for the given code.

For (int i=1; i>0, i++) {

*loop code*

}

  • The logical operator && cannot be used in a test condition Correct
  • The while loop is an exit-condition loop
  • The test condition is always false
  • The best condition is always true

Question No 9:

In call reference _______ operator (Raise For Success) is used to pass the address of a variable to the called

  • & Correct
  • *
  • #
  • %

Question No 10:

How many bits of memory (Raise For Success) needed for internal representation of class?

  • 1
  • 2
  • 3
  • No memory needed Correct



Question No 11:

Which of the following (Raise For Success) is introduced in C++ for memory allocation?

  • New
  • Realloc()
  • Alloc()
  • Malloc() Correct

Question No 12:

Instance of (Raise For Success) a class is _________.

  • Friend function
  • Object Correct
  • Data member
  • Member function

Question No 13:

The default scope (Raise For Success) for members of structures is ________.

  • Protected
  • Private
  • Public Correct
  • None

Question No 14:

What is the index numbers (Raise For Success) of the last element of any array with 9 elements?

  • 9 Correct
  • 8
  • 7
  • 6

Question No 15:

Pick out the correct (Raise For Success) statement about string template?

  • It is used to replace a string with another string at runtime
  • It is used to delete a string Correct
  • None of mention



Question No 16:

You can allocate memory at run time within the heap for the variable of a given type using a special operator in C++ which (Raise For Success) returns the address of the space allocated. This operator is called _______ operator.

  • New Correct
  • Delete
  • Copy
  • Deep

Question No 17:

If more than one arguments (Raise For Success) are passed to a function, they are separated by _________.

  • Semicolon
  • Comma
  • Double quotes Correct
  • Parenthesis

Question No 18:

Sequence of the events when (Raise For Success) allocating memory using new operator is ________.

  • Only block of memory is allocated objects
  • Only constructor is called for objects
  • Memory is allocated first before calling constructor Correct
  • Constructor is called first allocating memory

Question No 19:

Which of the following function (Raise For Success) call is correct for the function prototype?

  • defaultParameters (5);
  • defaultParameters (5,’8’); Correct
  • defaultParameters (6,’#’);
  • defaultParameters (0,0,’*’0);

Question No 20:

The function free() returns back (Raise For Success) the allocated memory got through calloc and malloc to ______.

  • Stack
  • Heap Correct
  • Free memory store
  • Both to heap and stack



Question No 21:

If we define an identifier with the statement (Raise For Success) #define P1 3.1215925 then during the execution of the program, the value of P1 ________.

  • Can not be replaced
  • Can be changed by using function
  • Remains constant Correct
  • Can be changed by some operation

Question No 22:

Computers can do ______ what (Raise For Success) we tell them to do.

  • More than
  • Less than
  • Exactly Correct
  • Similar

Question No 23:

_______ in the following (Raise For Success) options is not a method of input stream.

  • Getline()
  • Peek()
  • Unget() Correct
  • Write()

Question No 24:

ANSI stands (Raise For Success) for ________

  • Asian National Standards Institute
  • American National Standards Institute Correct
  • American Neutral Standards Institute
  • Australian National Standards Institute

Question No 25:

Ostream & beep (Raise For Success) (ostream & output) is the syntax of _____

  • Built-in manipulator
  • User-defined manipulator Correct
  • Template function
  • User-defined variables



Question No 26:

The first parameter (Raise For Success) of operator function for << operator.

  • Must be passed by value
  • Must be passed by reference Correct
  • Can not be passed by value or reference
  • Must be object of class

Question No 27:

What will be the (Raise For Success) output of following statement?

cout << setfill(‘0’) << set(7) <<128.

  • 0000128 Correct
  • 0128128
  • 1280000
  • 0012800

Question No 28:

Suppose a class A declares itself a (Raise For Success) friend of class B then this kind of friendship is called ______.

  • Association
  • One-way relationship Correct
  • Two-way relationship
  • Transitive redundancy

Question No 29:

For a multi-dimensional array (Raise For Success) the array elements are stored in the form of ________.

  • Columns
  • Table of rows and columns Correct
  • Contiguous memory locations
  • Fragmented memory locations

Question No 30:

Word processor is a (Raise For Success) type of an ________.

  • Operating system
  • Application software Correct
  • Device driver
  • Utility software



Question No 31:
Write a program, which (Raise For Success) dynamically creates an array of character type using malloc function. The size of the array will be specified by the user through keyboard?

Question No 32:
Write a code to overload extraction operator (Raise ForSuccess) for class Date which have the following data members day, month and year?

Question No 33:
Write a small program which defines a user-defined manipulator named “Octal”. This manipulator should convert and display the (Raise For Success) decimal number into octal form. In the main function, you have to take a decimal number as an input form the user and then by using a user-defined manipulator display the number in octal form?

Question No 34:
What is the first parameter of (Raise For Success) stream insertion (<<) and stream extraction (>>) operators?

Question No 35:

Find errors in the (Raise For Success) following code segment:

Date Date::operator++()

{

If (day=days (Raise For Success) OfMonth(*this) && month==12)

{

day=1

month=1;

++year;

};

Else if (day == daysOfMonth(*this))

{

day=1;

++month; (Raise For Success)

}

else

{

day++

}

}



Question No 36:

What will be the (Raise For Success) output of the following program?

#include<iostream>

Using namespace std;

#include (Raise For Success) <stdlib.h>

main()

{

Int*p;

p= (int *)malloc(20);

cout<<sizeof(p); (Raise For Success)

free(p);

}

Question No 37:

Using (Raise For Success) namespace std;

Template<classT>

class A

{

 Public: (Raise For Success)

T func(T a , T b)

Return a/b;

}

Question No 38:
Write a statement for opening file trans.txt (Raise For Success) for input; using an ifstream object called inTransaction?

Post a Comment

Previous Post Next Post