Hello, OnlineGDB Q&A section lets you put your programming query to fellow community users. Asking a solution for whole assignment is strictly not allowed. You may ask for help where you are stuck. Try to add as much information as possible so that fellow users can know about your problem statement easily.

How do I declare a variable in a scope?

+2 votes
asked Jan 7, 2018 by timothy johnsonII (140 points)
#include <iostream>

#include <string>

#include <vector>

#include <fstream>

using namespce std;

in main () {

              variable = (condition)? true : false

              int  largestNum = ( 5 . 2 ) ? 5 :  2;

              return 0;

}

1 Answer

0 votes
answered Jan 11, 2018 by anonymous

"variable = (condition)? true : false" this is syntax.

And below is example of it. Where "largestNum" is variable declared of "int" type.

int  largestNum = ( 5 . 2 ) ? 5 :  2;

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.
...