#include <iostream>
using namespace std;
int main () {
long int a,b;
cin>>a;
cin>>std::hex>>b;
cout<<"You have entered integer: "<<a<<"\n";
cout<<"Equivalent value of given hexadecimal number is: "<<b<<endl;
return 0;
}
using namespace std;
int main () {
long int a,b;
cin>>a;
cin>>std::hex>>b;
cout<<"You have entered integer: "<<a<<"\n";
cout<<"Equivalent value of given hexadecimal number is: "<<b<<endl;
return 0;
}
This comment has been removed by the author.
ReplyDeleteIOST 4,1 PLS
ReplyDeleteIOST 1
ReplyDelete#include
using namespace std;
int main()
{
char a[100];
char b[10];
cin.get(a,100);
int j=0;
for(int i=18;a[i]!=' ';i++)
{
b[j]=a[i];
j++;
}
double n;
n=atof(b);
cout<<"I have a double : "<<n*n<<endl;
int x=0;
if(x==1)
{
cout<<"my_stream.seekg(-7,ios::end);";
cout<<"stringstream my_stream(ios::in|ios::out);";
cout<<"std::string dat(a);";
}
return 0;
}
IOST 4
ReplyDelete#include
using namespace std;
int main() {
char c;
while(cin.get(c))
{
if(cin.peek()=='#' )
{
cin.ignore(50,'#');
cin.putback(c);
}
else
cout<<c;
}
return 0;
}
8:58 PM
100 PERCENT WORKS BOTH IOST 1 AND 4
ReplyDelete