Câu hỏi trắc nghiệm ngôn ngữ lập trình C (tiếp theo)
What is the result of this function
int foo(int j) {
int x = 5 ;
if( j == 0 ) {
int x ;
x = 3 ; }
return x ;
}
154.
What value is returned from a call to subroutine f?
int fred = 0;
void g(int fred) {
fred = 13 ;
}
int f() {
int fred = 42 ;
g( fred ) ;
return fred ;
}
What value is returned from a call to subroutine f?
int fred = 0;
void g(int &frieda) { // This line is different from last time.
frieda = 13 ; // So is this one
}
int f() {
int fred = 42 ;
g( fred ) ;
return fred ;
}
#include
using namespace std ;
int nutsy(bool flag) {
int fred ;
if( flag ) fred = 42 ;
return fred ; }
int main() {
cout << nutsy( true ) << endl ;
cout << nutsy( false ) << endl ; }
What is printed by this program
#include
#include
using namespace std ;
int main() {
int *p = new(nothrow) int ;
if( p!=0 ) {
*p = 99 ;
int *q = p ;
delete q ;
cout << *p << endl ; }
}
Q 158. What is printed by this program
#include
#include
using namespace std ;
int main() {
int *p = new(nothrow) int ;
if( p!=0 ) {
delete p ;
*p = 99 ;
cout << 12 << endl ; }
}
What is printed by this program
#include
#include
using namespace std ;
int main() {
int *p = new(nothrow) int ;
if( p!=0 ) {
*p = 99 ;
int *q = p ;
delete q ;
cout << *p << endl ; }
}
What is printed by this program
#include
#include
using namespace std ;
int main() {
int *p = new(nothrow) int ;
if( p!=0 ) {
delete p ;
*p = 99 ;
cout << 12 << endl ; }
}
NGUYỄN THỊ BẢO TRANG
» Tin mới nhất:
» Các tin khác: