Discussions Q&R
Void and Main
0 Vote
4 RéponsesPrint() or return()?
1 Vote
2 Réponses#include <iostream>
#include <bitset>
int main()
{
int myDecimalNumber;
std::cin >> myDecimalNumber;
std::string binary = std::bitset<8>(myDecimalNumber).to_string(); //to binary
std::cout<<binary<<"\n";
unsigned long decimal = std::bitset<8>(binary).to_long();
std::cout<<decimal<<"\n";
return 0;
}
2 Votes
5 RéponsesC#Love Chat-6
4 Votes
6 Réponsescan 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 Votes
3 RéponsesAujourd'hui en vedette
Data Analysis Course
1 Votes
Time up code for data revision
0 Votes
Web vs python
0 Votes
Is there LUA?
0 Votes