Questions – Exam Papers – Computer Sir Ki Class

Login


Lost your password?

Don't have an account ?
Register (It's FREE) ×
  


Shop
siteicon
Question Typewise Collection-"Very Short Answers" Questions - Exam Papers (CPP) No. of Q.13
Q.1   Exam - CBSE12D-2016/01B/1

Jayapriya has started learning C++ and has typed the following program. When she compiled the following code written by her, she discovered that she needs to include some header files to successfully compile and execute it. Write the names of those header files, which are required to be included in the code.

void main()
{
  float A,Number,Outcome;
  cin>>A>>Number;
  Outcome=pow(A,Number);
  cout<<Outcome<<endl;
}


Q.2   Exam - CBSE12D-2016/01A/2

Out of the following, find those identifiers, which cannot be used for naming Variable, Constants or Functions in a C++ program:

_Cost, Price*Qty, float, Switch,
Address One, Delete, Number12, do



Q.3   Exam - CBSE12D-2017/01B/1

Anil typed the following C++ code and during compilation he found four errors as follows:
(i) Function strlen should have a prototype
(ii) Undefined symbol cout
(iii) Undefined symbol endl
(iv) Function getchar should have a prototype
On asking his teacher told him to include necessary header files in the code.
Write the names of the header files, which Anil needs to include, for successful compilation and execution of the following code:

void main()
{
  char S[] = "Hello";
  for(int i = 0; i<strlen(S); i++)
  S[i] = S[i]+1;
    cout<<S<<endl;
  getchar();
}


Q.4   Exam - CBSE12D-2017/01A/2

Write the type of C++ tokens (keywords and user defined identifiers) from the
following:
(i) For
(ii) delete
(iii) default
(iv) Value



Q.5   Exam - CBSE12A-2015/01B/1

Observe the following program very carefully and write the name of those header file (s), which are essentially needed to compile and execute the following program successfully:

typedef char STRING[80];
void main()
{
STRING Txt[] = “We love Peace”;
int Count=0;
while (Txt[Count]!=’\0′)
if (isalpha(Txt[Count]))
Txt[Count++]=’@’ ;
else
Txt[Count++]=’#’ ;
puts (Txt) ;
}



Q.6   Exam - CBSE12A-2015/01A/2

Find the correct identifiers out of the following, which can be used for naming Variable, Constants or Functions in a C++ program:
For, while, INT, NeW, delete, 1stName, Add+Subtract, name1



Q.7   Exam - CBSE12D-2015/01B/1

Observe the following program very carefully and write the names of those header file(s), which are essentially needed to compile and execute the following program successfully:

typedef char TEXT[80];
void main()
{
  TEXT Str[] = "Peace is supreme";
  int Index=0;
  while (Str[Index]!='\0')
    if (isupper(Str[Index]))
    Str[Index++]='#';
    else
  Str[Index++]='*';
  puts(str);
}


Q.8   Exam - CBSE12D-2015/01A/2

Find the correct identifiers out of the following, which can be used for naming variable, constants or functions in a C++ program: While, for, Float, new, 2ndName, A%B, Amount2, _Counter



Q.9   Exam - CBSE12A-2016/01B/1

Ronica Jose has started learning C++ and has typed the following program. When she compiled the following code written by her, she discovered that she needs to include some header files to successfully compile and execute it. Write the names of those header files, which are required to be included in the code.

void main()
{
  double X,Times,Result;
  cin>>X>>Times;
  Result=pow(X,Times);
  cout<<Result<<endl;
}


Q.10   Exam - CBSE12A-2016/01A/2

Out of the following, find those identifiers, which can not be used for naming Variable, Constants or Functions in a C++ program:

Total*Tax, double, Case, My Name,
NeW, switch, Column31, _Amount



Q.11   Exam - CBSE12A-2017/01B/1

Anil typed the following C++ code and during compilation he found three errors as follows:
(i) Function strlen should have prototype
(ii) Undefined symbol cout
(iii) Undefined symbol endl
On asking, his teacher told him to include necessary header files in the code. Write the names of the header files, which Anil needs to include, for successful compilation and execution of the following  code

void main()
{
  char Txt[] = "Welcome";
  for(int C= 0; C<strlen(Txt); C++)
    Txt[C] = Txt[C]+1;
    cout<<Txt<<endl;
}


Q.12   Exam - CBSE12A-2017/01A/2

Write the type of C++ tokens (keywords and user defined identifiers) from the following:

(i) new
(ii) While
(iii) case
(iv) Num_2



Q.13   Exam - CBSE12A-2018/01A/2

Write the type of C++ tokens (keywords and user defined identifiers) from the following:
(i) else (ii) Long (iii) 4Queue (iv) _count