IOST3

#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; 
}

5 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. IOST 1
    #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;
    }

    ReplyDelete
  3. IOST 4
    #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

    ReplyDelete
  4. 100 PERCENT WORKS BOTH IOST 1 AND 4

    ReplyDelete