-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathins-switch.cpp
More file actions
36 lines (34 loc) · 790 Bytes
/
ins-switch.cpp
File metadata and controls
36 lines (34 loc) · 790 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
//
// ins-switch.cpp
// 1-programowanie-strukturalne\1-2-instrukcje-sterujace\1-2-5-switch\
//
// Created by Jakub Piskorowski on 19/01/2022 wersja: 1.0
// Copyright © 2022 Jakub Piskorowski. All rights reserved.
// GitHub: https://github.com/PiskorowskiJakub/programming-course-cpp
//
// Przedstawienie dzialania instrukcji sterującej switch
//
#include <iostream>
using namespace std;
int main()
{
int liczba;
cout << "Podaj liczbe: ";
cin >> liczba;
switch( liczba )
{
case 2:
cout << "dwa" << endl;
break;
case 1:
cout << "jeden" << endl;
break;
case 3:
cout << "trzy" << endl;
break;
default:
cout << "ani jeden, ani dwa, ani trzy" << std::endl;
break;
}
return 0;
}