Can all for statements be written as while statement. Vice Versa?

Yes.

for(<init>; <condition>; <iterator>){
   //...
   }
<init>
while(<condition>){
   //...
   <iterator>
   }
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.