CBSE Guess > Papers > Important Questions > Class XI > 2013 > Computer Science > Computer Science By Mr. Prabhuji Gupta
CBSE CLASS XI
Getting Started With C++
Most Important Questions
Q 1 What kinds of constants are the following?
14, 011, 0X2A, 17, 014, 0XBC1
Q 2 What will be the sizes of the following constants: ‘x’, “y”, Guneet’s”, ‘” ‘?
Q 3 Find the syntax error in the following code:
main()
{ int a, b :
cin >> a >> b;
cout << a + b,
return 0
}
Q 4 Explain the following types of errors:
Syntax error, Semantic error and Type error
Q 5 State the reason why the code given below is illegal. And how can we correct it?
main()
{
int i=j=k=0;
}
Q 6 Write a C++ program that inputs a student’s marks in three subjects and prints the average marks.
Q 7 Find errors in the following code:
int main()
{
cout << “Enter number”;
cin >> num
sqr = num * num
cout << “the square is”<< sqr;
Q 8 In C++, give the predefined objects for input, output and error.
Q 9 What do you mean by cascading output operator and cascading input operator?
Q 10 Arrange the following in the order of their precedence:
<< >>
<<= >>=
+ -
* / %
&&
Q 11 What are the advantages of cout and cin over printf() and scanf()?
Q 12 Do the following code segments perform the same job:
int a = 10;
int a(10);
Q 13 Are the given statements same?
enum grade g;
grade g;
Q 14 What does the modulo operator % do? What is the result of the expression 22.6%5.2?
Q 15 Given the following two definitions:
Unsigned int x1=0, x2=0;
What will be the result of each of the following expressions?
(a) x1 && x2
(b) x1 || x2
(c) ! x1
Q 16 Why should we avoid equality comparisons between floating point numbers?
Q 17 What is the value of expression ! (1 &&0 || !1).
Q 18 Why should we avoid comparing signed and unsigned values?
Q 19 Evaluate x+=x++ + ++x if, initially x= 5.
Q 20 Given the following code fragment
int marks=20;
cout << ++marks << ”n”;
cout << marks << ”n”;
(i) What output does the above code fragment produce?
(ii) What is the effect of replacing ++marks with marks++?
(iii) What is the effect of replacing ++marks with marks+1?
Q 21 What is the difference between run time error and syntax error?
Q 22 What do you understand by ‘code generation’?
Q 23 What is the condition that every C++ program must fulfill?
Q 24 Following are some of the real constants in exponent form. Choose the invalid form.
152E05, 1.52E07, .25E-7, 1520E04
Q 25 Explain the terms: tokens, keywords and identifiers.
Submitted By Mr. Prabhuji Gupta
Email: [email protected] |