We can use the loop for inside the sentence switch? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

We can use the loop for inside the sentence switch?

help please

28th Aug 2018, 5:54 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar
9 Answers
+ 3
Show it to me
28th Aug 2018, 6:07 PM
Sachin Artani
Sachin Artani - avatar
+ 2
Yes you can use for loop inside switch statement.
28th Aug 2018, 6:01 PM
Sachin Artani
Sachin Artani - avatar
+ 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.
28th Aug 2018, 6:13 PM
Sachin Artani
Sachin Artani - avatar
+ 2
here the code click on link and check https://code.sololearn.com/c326020ZgGDI/?ref=app
28th Aug 2018, 6:18 PM
Rishabh Mehta
+ 1
https://code.sololearn.com/cC5WK78J010t/?ref=app
28th Aug 2018, 6:24 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar
+ 1
this is my code sorry i'm slow
28th Aug 2018, 6:24 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar
0
as? i already have the Code and if it compiles but does not execute the loops for
28th Aug 2018, 6:07 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar
0
can you pass me your whatsapp? i work in my computer i don't know another way to show my code
28th Aug 2018, 6:11 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar
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
28th Aug 2018, 6:18 PM
Axel Andrés Cruz Córdova
Axel Andrés Cruz Córdova - avatar