Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <conio.h>
- using namespace std;
- int main(){
- int a;
- cout<<"Jaka jest twoja ulubiona liczba? Wpisz ja."<<endl;
- cin>>a;
- int x;
- while(true){
- cout<<"MENU wybierz cyfre od 1 do 4\n"
- "1-Wyswietl liczby od 1 do ulubionej(while)"
- "\n2-Wyswietl liczby od 1 do ulubionej(do-while"
- "\n3-Wyswietl tylko modulo 5 dla liczby od 1 do ulubionej(for)"
- "\n4-Wyswietl liczby wieksze niz 5 ale mniejsze niz 10"
- "\nABY ZAKONCZYC PROGRAM WCISNIJ 0"<<endl;
- cin>>x;
- int i=1;
- if(x==1){
- while(i<=a){
- cout<<i<<endl;
- i++;
- }
- }
- if(x==2){
- do{
- cout<<i<<endl;
- i++;
- } while(i<=a);
- }
- if(x==3){
- int modulo, m=5;
- for(i;i<=a;i++){
- modulo=i%m;
- cout<<modulo<<endl;
- }
- }
- if(x==4){
- while(i<=a){
- if(i>5 && i<10){
- cout<<i<<endl;
- }
- i++;
- }
- }
- if(x==0) break;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment