Sesiones de PyR
where's the error ?
-3 Votos
2 Respuestasclass and object
1 Voto
1 RespuestaWhy is not working
0 Votos
3 RespuestasWhye error???
0 Votos
1 Respuestacan someone please explain why this code keeps telling me complication error instead of outputting the value of speed.
#include <iostream>
using namespace std;
class myClass {
public:
void setcarspeed (int a){
speed=a;
}
int getcarspeed(){
return speed;
}
private:
int speed;
};
int main() {
myClass obj;
obj.setcarspeed (40);
cout<<obj.getcarspeed ;
return 0;
}
2 Votos
3 Respuestasusing System;
namespace GoodProgrammerTest
{
class Program
{
static void Main(string[] args)
{
Console.Write("Enter Yes or No");
Console.Write(
"Do you programme every day? : ") ;
int answer = Console.ReadLine();
if (answer =="Yes")
{
Console.WriteLine(
"You will be a good programmer");
}
else
{
Console.WriteLine(
"You will not be a good programmer");
}
}
}
}
2 Votos
3 RespuestasI am confused on this
0 Votos
1 Respuestajava learning
0 Votos
1 RespuestaWhy not working
-4 Votos
4 RespuestasEn tendencia hoy
Audio adding
1 Votes
What is problem in this code
0 Votes
Stuck in Quize
1 Votes
playground input
0 Votes
C Program
0 Votes
Software developer
0 Votes