New course! Every coder should learn Generative AI!
Try a free lessonQ&A Discussions
Am I to type return 0;?
0 Votes
1 Answer#include <iostream>
using namespace std;
int calc(int &a,int &b,int c=6)
{
a+=b;
b-=c;
c=a+b;
}
int main()
{
int calc(int,int,int);
int x=2,y=3,z=4; cout<<x<<endl<<y<<endl<<z<<endl;
calc(x,y,z); cout<<x<<endl<<y<<endl<<z<<endl;
calc(5,6,z); cout<<x<<endl<<y<<endl<<z<<endl;
return 0;
}
1 Vote
5 Answers#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 AnswersHot today
Media on HTML
0 Votes
Is Sololearn better or Mimo.org?
2 Votes
How to cast in python
0 Votes
How to show img???
0 Votes
Java project
0 Votes
Python
0 Votes
Jungle capming
0 Votes
JavaScript
0 Votes
Editor HTML
0 Votes