Advertisement
overridetut

Untitled

Mar 31st, 2015
218
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5. int main (){
  6. int x;
  7. cout<<"unesite broj x: ";
  8. cin>>x;
  9. cout<<"FOR"<<endl;
  10. cout<<"-----------------------"<<endl;
  11. for(int i=1; i<=x;i++ )
  12. cout<<i<<"."<<"dobar dan! "<<endl;
  13. int b=1;
  14. cout<<"WHILE"<<endl;
  15. cout<<"-----------------------"<<endl;
  16. while(b<=x){
  17. cout<<b<<"."<<"dobar dan! "<<endl;
  18. b++;
  19. }
  20. cout<<"DO WHILE"<<endl;
  21. cout<<"-----------------------"<<endl;
  22. int y;
  23. do {
  24. cout<<"Unesite broj: ";
  25. cin>>y;
  26. }while(y<0);
  27. for (int i = 0; i<y;i++)
  28. cout<<"dobar dan"<<endl;
  29.  
  30.  
  31.  
  32.  
  33.  
  34. system("PAUSE");
  35. return 0;
  36. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement