+ 1
We can use the loop for inside the sentence switch?
help please
9 ответов
+ 3
Show it to me
+ 2
Yes you can use for loop inside switch statement.
+ 2
I am sorry, I cannot share my personal details here.
You can simply login to SoloLearn via browser and open the playground and save your code there or save your code in this app and share the link here.
+ 2
here the code click on link and check
https://code.sololearn.com/c326020ZgGDI/?ref=app
+ 1
https://code.sololearn.com/cC5WK78J010t/?ref=app
+ 1
this is my code sorry i'm slow
0
as? i already have the Code and if it compiles but does not execute the loops for
0
can you pass me your whatsapp? i work in my computer i don't know another way to show my code
0
//Programa que imprima los numeros de un intervalo
#include<iostream>
#include<conio.h>
using namespace std;
int main(){
int intervalo,s,m;
cout<<"Escoge un tipo de intervalo: "<<endl;
cout<<" Intervalo cerrado[] (1)"<<endl;
cout<<" Intervalo abierto() (2)"<<endl;
cout<<" Intervalo mixto [) (3)"<<endl;
cout<<"Intervalo mixto (] (4)"<<endl;
cout<<"Digite el numero que aparece en el parentesis del intervalo que desea: ";
cin>>intervalo;
switch(intervalo){
case 1:
cout<<"Ingrese los exremos del intervalo"<<endl;
cout<<"Extremo menor: "; cin>>m;
cout<<"Extremo mayor: "; cin>>s;
for(int i = m; i <= s; i++){
cout<<"Los numeros dentro del intervalo son: "<<i<<endl;
break;
}
case 2:
cout<<"Ingrese los exremos del intervalo"<<endl;
cout<<"Extremo menor: "; cin>>m;
cout<<"Extremo mayor: "; cin>>s;
for(int i = m+1; i < s; i++){
cout<<"Los numeros dentro del intervalo son: "<<i<<endl;
break;
}
case 3:
cout<<"Ingrese los exremos del intervalo"<<endl;
cou