I can not find the problem of this code.......
I am now using Dev C++ editor for coding.

#include<iostraem.h>
#include<conio.h>
#include<stdio.h>

using namespace std;

int main(){

     int k=1;
    int m=0;
    int p=5;
    //int arry[];
    int v=0;
    int i=0,j=0;

    cin>>i;
    cin>>j;

    for(int n=i;n<=j;n++,v++){
        m=n;
    while(n>1){
        if(n%2!=0){
        n=3*n+1;
        }
        else n=n/2;
        k++;
        cout<<n;


}
    //for(int d=0;d<arry.length;d++)
   // arry[v]=k;
       n=m;
    cout<<"Cycle="<<k;
    k=1;
    //System.out.println(" "+n+" ");
        p++;
    }
    return 0;
    }

Compiler errors are.....

\volum_1_1.cpp G:\G iostraem.h: No such file or directory. 
 16 G:\volum_1_1.cpp `cin' undeclared (first use this function) 
 27 G:\volum_1_1.cpp `cout' undeclared (first use this function) 

Recommended Answers

All 7 Replies

Firstly , iostream is spelt wrong.
Secondly, Please use a better "new" compiler. the ".h" has been deprecated ages ago!

I can not find the problem of this code.......

After 300 post one would think you'd know how to ask questions by now.

Always explain why you think there is a problem. If you don't tell us why you think there's a problem (error messages, bad output, whatever) how do we know what to look for?

Walt, he did post the errors.. However they r embedded into his code-segment.

Ok guys, I'm a newbie too.But that was really easy.

The iostream takes care of your cin and cout, there are 3 compile errors given you direct clue that there's a problem with that header include.

In fact, that's one of the first things I learned about C++, togheter with the 'hello world'

In your program the <iostream> is spelled wrong, but as I can now see, it was already covered by some1 else, and the .h is depreciated in the C++ language nowdays.

and the .h is depreciated in the C++ language nowdays.

You mean deprecated, and that's still not correct. Deprecated is a term used for standard C++ features that have been superseded by another feature and are no longer recommended for use because they may be removed from the standard in a future revision. <iostream.h> was never a standard header, it was morphed into
<iostream> during development of the first release of ISO C++, so deprecation status is impossible.

<iostream.h> is simply non-standard.

iostream correction
go to option and check the directies to erase

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.