Pls help me in my project.....

My prof. said create a program using loop statement,nested loop while loop,do loop,for loop.can u give me some problem in visual basic in c++ using all of that?
It better u give me the harder one because the harder the highest grade.. ^^
i have example of program have been create to give u idea.But the example i have given to u has not use in any kind of loop ^^... i need it very soon..
example:
#include<iostream.h>
#include<stdlib.h>
void main()
{
int num,x,sum=0;
cout<<"Enter an interger:";
cin>>num;
for(x=1;x<num;x++)
{
if(num%x=0)
cout<<x<<"\t";
sum=sum+x;
}
}
cout<<"The sum of factors:"<<sum<<endl;
if(sum==sum)
cout<<"Then no. is DWARF"<<endl;
else
cout<<"The no. is Not DWARF"<<endl;
}



this example cant be use in loop statement,nested loop,while loop,do loop,for loop.tnx i be waiting...... ^^
I nid the program in 3 days T_T
a few simple problems my tutor gave me last time.

display a row of stars using stars (*)
input = 8 (cin << 8)
output =
********

display decreasing rows of stars
input = 4
output =
1
2
3
4
****
***
**
*


display an big X.
input = 8
output =
1
2
3
4
5
6
7
*      *
 *    *
  *  *
   **
  *  *
 *    *
*      *


can all be done using while/do-while/for (some might need nested loops)

for the hardest question. u can try the hanoi tower qn using many loops. easily googled.
Last edited on
Topic archived. No new replies allowed.