Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- using namespace std;
- void nombreDelDia(int dia, string nombre[], int tam);
- int main(void){
- const int tamanio=7;
- int dia;
- string nombre[tamanio]={"Domingo", "Lunes", "Martes", "Miercoles", "Jueves", "Viernes", "Sabado"};
- cout << "Dia nro: ";
- cin >> dia;
- nombreDelDia(dia, nombre, tamanio);
- return 0;
- }
- void nombreDelDia(int dia, string nombre[], int tam){
- if(dia<tam){
- cout << "Dia " << nombre[dia];
- }else{
- cout << "Valor incorrecto" << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement