Cadernos de Questões

Provas Favoritas

Filtros Salvos

Foram encontradas 50 questões.
#2255723

Analise o código C++ abaixo. 


#include <iostream>

class Test{ 

 static int a; 

 int b; 

 

 public: 

 Test(int b){ 

 a++; 

 this->b = b; 

 } 

 void print(){ 

 std::cout << a << "," << b << std::endl; 

 }; 

}; 

int Test::a = 0; 

int main(){ 

 Test t1(20); 

 Test t2(30); 

 t1.print(); 

 t2.print(); 

 return 0; 

}



Os valores impressos pelo código C++ acima são:  

  • 1,202,30
  • 2,202,30
  • 1,201,30
  • 2,201,30
  • 2,302,30
Fale com IAgo
IAgo - Assistente IAProva
IA
Olá! Sou o IAgo, seu assistente aqui no IAProvatec 😊
Veja como posso te ajudar:
Agora