Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
a) ?1 is getchar()!=\n ?2 is getchar(c.;
b) ?1 is (c=getchar())!=\n ?2 is getchar(c.;
c) ?1 is C!=\n ?2 is putchar(c.;
d) ?1 is (c=getchar())!=\n ?2 is getchar(c.;
a) 10
b) 11
c) 0
3) main()
{
static int a[20];
int x=0;
a[x]=x++;
printf(\n %d %d %d, a[0],a[1],x);
}
a) 0 1 1
b) 0 0 0
c) 0 1 0
d) 0 0 1
7) main()
{
float a=0.7;
if(a<0.7f)
printf(C);
else
printf(C++);
}
a) C
b) C++
c) Error
d) None of above
8) main()
{
int x=10,y=20,z=5,a
a=x<y<z;
printf(%d,a.;
}
a) 1
b) 0
c) error
d) none of above.
a) if (!n)c = b; else c = a
b) if (n <= 0)c = b; else c = a;
c) if (n > 0)c = a; else c = b;
d) All of the mentioned
14) When a child class inherits traits from more than one parent class, this type of inheritance is called
_______________ inheritance.
a. Hierarchical
b. Hybrid
c. Multilevel
d. Multiple
15) If the derived class is struct, then default visibility mode is_______
a. public
b. protected
c. private
d. struct cant inherit class
16) When base class is derived in protected mode, then______________
a. Only 1, 5
b. Only 1, 6
c. Only 2, 6
d. 2 , 4
17) What is difference between protected and private access specifiers in inheritance?
a. private member is not inheritable and not accessible in derived class
b. protected member is inheritable and also accessible in derived class
c. Both are inheritable but private is accessible in the derived class
d. Both are inheritable but protected is not accessible in the derived class
18) Which of the following perfect set of operators cant be overloaded in CPP ?
a. +=, ?, :: , >>
b. >>, <<, ?, *, sizeof()
c. :: , . , .* , ?:
d. :: , ->, * , new, delete
19) Members of the class can be declared with auto, extern or register storage classes.
a. True
b. False
a. Only 1,4,5
b. Only 2,3,5
c. Only 1,3,4
d. All of these
23) Which of the following is correct about the statements given below?
I.All operators can be overloaded in C++.
II.We can change the basic meaning of an operator in C++.
a.Only I is true.
b.Both I and II are false.
c.Only II is true.
d. Both I and II are true.
a) i = 20; i++;
b) for (i = 0; i<20; i++) { }
c) a = i++;
d) while (i++ = 20) cout << i;
27) Consider the statements a = 13 ; c = a<< 3 ; (a and c are integers). The result assigned to the integer c is
a) 104
b) 114
c) 140
d) 14
29) Which of the following best defines the syntax for template function ?
30) In a program, If there exists a function template with two parameters and normal function say void
add(int , int), so add(3,4) will_____________________
a.DQL Language
b.DDL Language
c.DCL Language
d.DML Language
a.TCL Language
b.DDL Language
c.DCL Language
d.DML Language
a.Tuple
b.Entity
c.Row
d.Column
a.Foreign
b.Primary
c.Candidate
d.Composite
35) Which is the correct SELECT statement to display all records with all columns of a table?
37) Which is the correct syntax for INSERT INTO statement without specifying column names?
a.DROP database_name
b.DROP database_name DATABASE
c.DROP DATABASE * database_name
d.DROP DATABASE database_name
a. Equijoins
b. Cartesian
c. Both and b
d. None of the mentioned
40) The following SQL is which type of join: SELECT CUSTOMER_T. CUSTOMER_ID, ORDER_T.
CUSTOMER_ID, NAME, ORDER_ID FROM CUSTOMER_T,ORDER_T ;
a.Equi-join
b.Natural join
c.Outer join
d.Cartesian join
a.x is 1
b.x is 2
c.x is 3
d.x is 4
43) Analyze the following code fragments that assign a boolean value to the variable even.
Code 1:
if number % 2 == 0:
even = True
else:
even = False
Code 2:
even = True if number % 2 == 0 else False
Code 3:
even = number % 2 == 0
a.Code 2 has a syntax error, because you cannot have True and False literals in the conditional expression.
b.Code 3 has a syntax error, because you attempt to assign number to even.
c.All three are correct, but Code 1 is preferred.
d.All three are correct, but Code 3 is preferred.
a.x is 0
b.x is 1
c.x is 2
d.x is 4
a. -10
b. 0
c.10
d. 20
e.Illegal expression
a.Correct
b.Incorrect
c.nothing
d.Correct Incorrect
a.print(s[0])
b.print(s.lower())
c.s[1] = 'r'
d.print(s.strip())
a.God
b.Good
c.Geed
d.Ged
e.Good
a. a global variable
b. a function variable
c. a block variable
d. a local variable
50) Suppose t = (1, 2, 4, 3, 8, 9), [t[i] for i in range(0, len(t), 2)] is _________.
a.[2, 3, 9]
b.[1, 2, 4, 3, 8, 9]
c.[1, 4, 8]
d.(1, 4, 8)
e.(2, 3, 9)