Programming c++

+2 votes
asked Dec 18, 2017 by anonymous
if the program ask us to enter the number of cases so for example 3 cases so there will be 3 pairs of number but when i run the program the output will produce more than 3 cases. what should i do? hope that this cold be answered ASAP

3 Answers

0 votes
answered Dec 30, 2017 by Eduardo Yánez (240 points)
Your question is not easy to understand, very imprecise.
0 votes
answered Jan 3, 2018 by Marco Túlio (140 points) 1 flag
You can use the keyword ''switch''

intmain(){

int value=0;

cout<<"Insire some value""<<endl;

cin >> value;

switch(value)

{

case 1:  //the enter value needs to be equal to case value

       {

        

        break;

       }

}

}
0 votes
answered Jan 17, 2018 by AlfaV Play (AlfaV) (220 points)

You can use operator Switch or operator if.

if:

int change = 1 // other number

if(change == 0)

{

first_function

}

else if(change == 1){

second_function

}

...

or Switch

written below
Welcome to OnlineGDB Q&A, where you can ask questions related to programming and OnlineGDB IDE and and receive answers from other members of the community.
...